I wanted to create a button that when the player clicks on it a GUI.window will appear I tried to create it but it ends up a mess so please can someone help me about this?
whenever i click play the window will appear immeadetly
var StartBtn : Texture2D;
var Options : Texture2D;
var Quit : Texture2D;
var show : boolean = false;
public var MyAudio : AudioClip;
function OnGUI () {
if(GUI.Button(Rect(470,250,130,60), StartBtn))
{
audio.PlayOneShot(MyAudio);
Application.LoadLevel("Continue");
}
if(GUI.Button(Rect(470,310,130,60), Options));
{
show = true;
audio.PlayOneShot(MyAudio);
}
if (show) {
GUI.Window (0, Rect (110,10,200,60), ShowWin, "Basic Window");
}
if(GUI.Button (Rect (470, 370,130,60), Quit))
{
(Input.GetKey ("escape"));
audio.PlayOneShot(MyAudio);
Application.Quit();
}
}
function ShowWind (windowID : int)
{
GUI.Button (Rect (10,30, 80,20), “Click Me!”);
}