Hey Chris,
I've been retooling my menus a little bit, and instead of having two variants of each submenu like you describe in the tutorial - one for the Main Menu and one for the Pause menu - I decided to use Actionlists to check whether the game is in scene 0 (the main menu) or not, and deciding that way which menu to return to when pressing the Back button.
This works great in theory, but what I've found is that, during gameplay, if I go into the Pause menu, then go into one of the submenus like Options or Controls, then click Back to go into the Pause menu again, the game unpauses! (I am running an in-scene actionlist at the same time)
There's a warning that the Actionlist can't continue because the Pause menu was turned on. But the whole actionlist is supposed to stop when the Pause menu turns on anyway, that's the last action in the actionlist, and it's set to Stop. It's not even fading.
So then I tried to do it via script, but it turns out the same way. Here's the script I used in MenuSystem.cs:
if (_menu.title == "Controls") {
if (_element.title == "Back") {
_menu.TurnOff(true);
if (Application.loadedLevel == 0) {
PlayerMenus.GetMenuWithName("Main Menu").TurnOn(true);
}
else {
state.GameState = GameState.Paused;
PlayerMenus.GetMenuWithName("Pause").TurnOn(true);
}
}
}
Is this a bug, or any way to work around it?
Comments
@hedgefield: If you've changed the gameState through code, that's probably why! If you change AC's code, it's not really an "AC bug" if it causes a problem elsewhere.
I'm not clear on why you're changing the gameState. If you could break that down for me better, I might be able to suggest an alternative.
Try using the Engine: Manage systems Action to disable Interaction etc when the Menu appears. This will prevent Hotspots etc from being clickable, but should still keep your Menu active.