in the old unity i learned from a tutorial how to make a script to do that but now in unit 5 it doesn't work. can someone help me with changing the code so that it works. on this link is the tutorial [youtube link][1]
and this is the code line in java
hope someone can help me
greetings danny
var levelToLoad : int;
var soundhover : AudioClip;
var beep : AudioClip;
var QuitButton=false;
function OnMouseEnter(){
GetComponent.().PlayOneShot(soundhover);
}
function OnMouseUp(){
GetComponent.().PlayOneShot(beep);
yield new WaitForSeconds(0.35);
if(QuitButton){
Application.Quit();
}
else{
Application.LoadLevel(levelToLoad);
}
}
@script RequireComponent(AudioSource)
[1]: https://www.youtube.com/watch?v=Z8YGKQvEz1Y
↧