How do I use Application.LoadLevel to load the next consecutive scene?
(sorry about how its all stuck together I don’t know how to fix it)
function Start() {
yield WaitForSeconds(1);
Application.LoadLevel(whatever code it is);
}
thanks
Well you could name your scene with consecutive names: Level1, Level2.
This way you get the digit of the scene, add 1 and load the next scene:
string nextLevel = "Level";
string level = Application.loadedLevelName.AsEnumerable().Where(char.IsDigit);
int value = int.Parse(level);
value++;
nextLevel+=value.ToString();
Application.LoadLevel(nextLevel);
Or, place them in order in the build and just increase the index:
int level = Application.loadedLevel;
level++,
Application.LoadLevel(level);