I am using a script to load my levels but i can’t figure out how to make them not active until for instance level 1 is beaten. Only then you could play level2 and so on.
var levelToLoad : String;
var soundhover : AudioClip;
var beep : AudioClip;
var QuitButton : boolean = false;
function OnMouseEnter(){
audio.PlayOneShot(soundhover);
}
function OnMouseUp(){
audio.PlayOneShot(beep);
yield new WaitForSeconds(0.35);
if(QuitButton){
Application.Quit();
} else{
Application.LoadLevel(levelToLoad);
}
}
@script RequireComponent(AudioSource)