Hi,
I have a simple game with just 1 scene and 1 XML. On the start of the scene I look at the XML where I have the level structure.
My issues is now how to change to next level, I’ll need to pass the number of level to the scene. Also I tried Application.LoadLevel (but it’s says is deprecated). How can I do it?
using UnityEngine.SceneManagement;
public class Example
{
public void LoadLevel()
{
// load the nextlevel
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
}
Then load the same scene, but increase the variable and Handle whatever it does on the load, or via a Singleton.
But thats why scenes are there for, idk why you would want to do this.
It´s a post from 3 years ago.
Furthermore, what you posted is the same + an OnTriggerEnter2D that has nothing to do with what OP asked. Perhaps you posted on the wrong thread?