tnx to “worldofcars” i was able get the gui buttons to work but what is wrong with my script it doesnt show the buttons when I click the button?
the script:
var shownewgame : boolean = false;
var showcontinue : boolean = false;
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();
}
shownewgame = true;
showcontinue = true;
}
function Update(){}
function OnGUI(){
if(shownewgame == true){
if(GUI.Button(Rect(0,40,200,30),"New Game")){
//Code for new game button
}
}
if(showcontinue == true){
if(GUI.Button(Rect(0,80,200,30),"Continue")){
//Code for continue button
}
}
}