- Home /
Question by
andibonoya2 · Jun 19, 2014 at 04:17 PM ·
gui button
show another gui menu
newbie need help... how to show another gui menu when click gui button..?
var GUIEnabled : boolean = false;
function Update()
{
if(Input.GetKeyDown(KeyCode.Q))
{
GUIEnabled = !GUIEnabled;
}
function OnGUI ()
{
GUI.skin = MenuSkin;
if (GUIEnabled){
var groupWidth = 250;
var groupHeight = 280;
var x = ( Screen.width - groupWidth ) / 2.0;
var y = ( Screen.height - groupHeight ) / 2.0;
GUI.BeginGroup( Rect(x,y,groupWidth,groupHeight) );
GUI.Box( Rect(0,0,250,200 ),"Menu List :");
if(GUI.Button (Rect (40,40,180,40), "floor 2")){
transform.position = SpawnPoint.position;
}
if(GUI.Button (Rect( 40,83,180,40),"option")){
........................
}
GUI.EndGroup ();
}
}
how to show another gui box when i press Button "Option" and hide active gui ??
Comment