I have a player Pref that i want to load a new level only if the score is 3. Can anyone help me?
function OnTriggerEnter (other : Collider) {
if (PlayerPrefs == 3){
yield WaitForSeconds (3);
if( Application.loadedLevel + 1 < Application.levelCount )
Application.LoadLevel( Application.loadedLevel + 1 );
else {
Application.LoadLevel (0);
}
}
Is this what you mean? function OnTriggerEnter (other : Collider) { if (PlayerPrefs.GetInt("3") >= 3) { yield WaitForSeconds (3); if( Application.loadedLevel + 1 < Application.levelCount ) Application.LoadLevel( Application.loadedLevel + 1 ); else Application.LoadLevel (0); } }
– MRPoof