In my game there is a loading screen that uses a PlayerPref to either load the tutorial or the title screen, depending on if it is your first play. It was working fine, until I added a new scene in the build setting before it, and now it’s stopped completley. Any ideas? Here the code if it helps:
#pragma strict
var newskin : GUISkin;
function Start()
{
yield WaitForSeconds(3);
if(PlayerPrefs.HasKey("savedLevel")){
// there is a saved level, load that one
Application.LoadLevel(PlayerPrefs.GetInt("savedLevel"));
}else{
// no saved level, load the first one
Application.LoadLevel(3);
}
}
function OnGUI () {
GUI.skin = newskin;
GUI.color = Color.black;
GUI.Label (Rect (635, 650, 500, 500), "Loading...");
}