i have my pause menu all designed how i want it, plus a restart level and a resume button, but my next 2 buttons are “Options” and “Character Setup” which is dealing with hiding the buttons on the main pause screen and showing the other buttons for the selected menu. im trying to use booleans to trigger when menu’s are showing or not, but when i press the “X” button to open the Options menu none of the buttons hide and no other buttons show up. how can i fix this, or is there another way i could switch menu’s?
private bool mainPause;
private bool optionPause;
void OnGUI() {
mainPause = true;
optionPause = false;
if (mainPause == true){
/////////////////////X Button////////////////////////////////////////////
if(GUI.Button(new Rect(Screen.width*.045F, Screen.height*.2F, Screen.width.2F, Screen.height.025F), "Options")){
mainPause = false;
optionPause = true;
}
GUI.EndGroup();
}
else if (optionPause == true){
/////////////////////Y Button////////////////////////////////////////////
if(GUI.Button(new Rect(Screen.width*.15F, Screen.height*.1F, Screen.width.2F, Screen.height.025F), "Restart Level")){
Application.LoadLevel("Training Layout");
Time.timeScale = 1.0f;
player.GetComponent<MouseLook>().enabled = true;
cam.GetComponent<MouseLook>().enabled = true;
cam.GetComponent<ShowSkin>().enabled = false;
}
GUI.EndGroup();
}
}
this is a shortened version of my code, i took out unnecessary buttons that wouldn’t effect anything. if you want me to post up the full script let me know…
any help is appreciated