Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

A yield function for function Update?

$
0
0
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"); } }

Viewing all articles
Browse latest Browse all 171066

Trending Articles