|
How to make a Music Game - Java Code - Level_end
[Back]
Code:
#pragma strict
function Start () {
audio.Play();
sound();
}
function sound ()
{
yield WaitForSeconds (audio.clip.length);
if ( Maincode.score >= Maincode.Song1highscore )
{
Maincode.Song1highscore = Maincode.score;
Application.LoadLevel("Song1Highscore");
}
else
{
Application.LoadLevel("Song1Highscore");
}
}
function Start () {
audio.Play();
sound();
}
function sound ()
{
yield WaitForSeconds (audio.clip.length);
if ( Maincode.score >= Maincode.Song1highscore )
{
Maincode.Song1highscore = Maincode.score;
Application.LoadLevel("Song1Highscore");
}
else
{
Application.LoadLevel("Song1Highscore");
}
}