I'm working on a platform game where you as a player have to collect logs, to keep on all the fires in the level. Each campfire has a timer, which ensures that every x number of seconds the animation of the fire is changed to a numb fire. The timer of a campfire is blocked by the script, when the player has received the fire at 100%. When all fires are 100% you won, if not you lose.
Know I use the following if statement to check if the player has won or lose:
if (Application.loadedLevelName == "Level 0") {
if (campfireAmount == allCampfireFull) {
// Do something
print ("level 1 complete");
Application.LoadLevel (6);
}
if (campfireAmount == allCampfireEmpty) {
// Do something
print ("level 1 failed");
//Application.LoadLevel ("GameOver");
}
}
What I searching for is how I can make this if statement useful for each level, whiteout use for each level scene above if statement. Beside that, what I want is that after each level you get a win scene (if possible a reusable scene) and after clicking in that scene on a button, you should go to the next level scene. Is there a way to load the next level, whiteout set a hard number of the rang list of "Build Settings"?