I have a puzzle game where I’d like to be able to switch scenes based on my current level. If I start on level 5 Id like to move to level 6 ext. I have each scene named just a number and tried using a counter but obviously if I start on level 3 the counter starts at 1
can I pull the name of the current level?
var k=1;
function OnCollisionEnter(coll: Collision) {
yield WaitForSeconds (.1);
if(coll.gameObject.name == "Player"){
if (GameObject.Find("cubeMaker(Clone)") == null) {
k++;
Application.LoadLevel(k);
}
else{
Application.LoadLevel(Application.loadedLevel);
}
}
}