I need to add a **yield new WaitForSeconds(2);** where the application loads the level...How will I do this? :)
var timer: float = 30;
var isFinishedLevel : boolean = false;
function Update()
{
if (!isFinishedLevel)
{
timer -= Time.deltaTime;
}
if (timer > 0)
{
guiText.text = timer.ToString("F0");
}
else
{
GameMaster.currentScore +=1;
if (GameMaster.currentScore > PlayerPrefs.GetInt("ScoreScript")){
PlayerPrefs.SetInt("ScoreScript", GameMaster.currentScore);
}
Application.LoadLevel("Level5");
}
}
↧