Okay so I have a “MainMenu” and a “LevelSelection” GUI
When Selection is open it closes and opens MainMenu, if MainMenu is open it closes, If neither are open then MainMenu Opens
void Update() {
if (guimain.enabled == true)
{
if (Input.GetKeyDown("escape"))
{
guimain.enabled = false;
}
}
if (guimain.enabled == false)
{
if (Input.GetKeyDown("escape"))
{
if (GUIlevelsel.enabled == true)
{
GUIlevelsel.enabled = false;
guimain.enabled = true;
}
if (GUIlevelsel.enabled == false)
{
guimain.enabled = true;
}
}
}
}
Okay so for some reason… depending on where I place it, it acts differently
if the disable is last then it wont open at all, if the enable is last then it will open but I cannot close it!
How do I code it so it doesn’t do the first then the 2nd if right after, I only want escape click to do 1 thing which is either