I would modify the script as below. Just add the sound and the "stage complete" text!
var countdown = false;
function Update(){
var bricks = GameObject.FindWithTag("brick");
if(bricks == null && !countdown){
countdown = true;
NextLevel();
}
}
function NextLevel(){
yield WaitForSeconds (5);
Application.LoadLevel(Application.loadedLevel + 1);
}
↧