I then went to the "back" button on the settings panel, and set that to change the settings panel to "inactive"
Now I can show and hide the settings panel.
Now to set the "escape" key to show the main menu, or hide all menus. First of all, I added a boolean called "EscapeActivated" When it is 'true' the main menu will appear. When it changes to false, all menus will disappear (if the player is in-game).
I ended up running into a problem. When I put the script on one of the menus, it won't work, because at some point the menu will be deactivated, and the script with it.
So what I'll need to do next class is make a new empty game object, and put the script on that and have the script remotely activate/deactivate the menus from there.
No comments:
Post a Comment