Hey! I’ve got stucked with an issue about the Loose Screen.
I was trying to get work a Loose Screen where if you loose the second level you wont have to start over again at first level when you click onto “Retry” the second level gets loaded.
This is what I tried out:
public int levelsCompleted = 0;
public void BrickDestroyed(){
if (Brick.breakableCount <= 0){
LoadNextLevel++;
print ("levelsCompleted: "+levelsCompleted);
LoadNextLevel();
Brick.breakableCount = 0;
}
}
public void LoadOnLevel(){
if (levelsCompleted == 0){Application.LoadLevel("level_01");}
else if (levelsCompleted == 1){Application.LoadLevel("level_02");}
else if (levelsCompleted == 2){Application.LoadLevel("level_03");}
else if (levelsCompleted == 3){Application.LoadLevel("level_04");}
else if (levelsCompleted == 4){Application.LoadLevel("level_05");}
else if (levelsCompleted == 5){Application.LoadLevel("level_06");}
else if (levelsCompleted == 6){Application.LoadLevel("level_07");}
else if (levelsCompleted == 7){Application.LoadLevel("level_08");}
else if (levelsCompleted == 8){Application.LoadLevel("level_09");}
else if (levelsCompleted == 9){Application.LoadLevel("level_10");}
else if (levelsCompleted == 10){Application.LoadLevel("level_11");}
else if (levelsCompleted == 11){Application.LoadLevel("level_12");}
else {}
}
I’ve set the retry button LoadOnLevel but keeps starting level 1 first.
Any suggestion?