Hi guys ive made a script for a GUI that has a button on a boolean that is at the bottom of the screen and when it is tapped it opens a GUIbox with buttons that when these buttons are tapped they open a new scene in it and then when the original button is tapped again it closes the GUIbox.
But with this script when i tap the “select team” button it opens up the liverpoolkit scene with out the button labelled liverpool being tapped. Any idea what is wrong with my code?
Thanks in advance
D
var isBoxShowing : boolean;
function OnGUI () {
if(GUI.Button(Rect((Screen.width * 0.5) - 200, Screen.height - 90, 200, 70), "choose your shirt"))
{
isBoxShowing = !isBoxShowing;
}
if(isBoxShowing)
{
GUI.Box(Rect((Screen.width * 0.5) -200,(Screen.height * 0.5) - 300, 400, 600), "select team");
if(GUI.Button(Rect((Screen.width * 0.5) -180,(Screen.height * 0.5) - 260, 360, 40), "Chelsea"));
{
Application.LoadLevel("Chelseakit");
}
if(GUI.Button(Rect((Screen.width * 0.5) -180,(Screen.height * 0.5) - 210, 360, 40), "Barcelona"));
{
Application.LoadLevel("Barcelonakit");
}
if(GUI.Button(Rect((Screen.width * 0.5) -180,(Screen.height * 0.5) - 160, 360, 40), "Manchester"));
{
Application.LoadLevel("Manchesterkit");
}
if(GUI.Button(Rect((Screen.width * 0.5) -180,(Screen.height * 0.5) - 110, 360, 40), "Liverpool"));
{
Application.LoadLevel("Liverpoolkit");
}
}
}