Like the title says, I’m trying to set up my main menus right now (I’m using EZGui). However, I’m having trouble with the basic logic behind it.
In XNA I set up a game manager class and attach numbers to each of the menus or game modes (essentially making an array). I do this for draw and update individually (initializing is front-loaded).
With Unity, I don’t feel like I have the same ability to do this since scripts are all attached to individual items.
Can someone just help me out with how I link together menus and my game? I don’t need code if you don’t want to write it, theory should do just fine.
I’m not quite sure what you mean. You can link your GUI to your game simply by, in your GUI, changing variables and calling functions that do things in the game.
That’s not necessarily the issue. In game GUI is easy. I’m just having trouble with main menus.
Like I haven’t found any scripts or tutorials that show how to link one menu to another or what happens when I hit start game. I probably need to do some kind of load script to place all the game objects right? I can’t do this on a global level like I could with XNA. I have to do it individually on a per button basis, since that’s how scripts function. I honestly just can’t think of the logic right now that will get me from Main Menu button 1 to Sub Menu button 1 or from Main Menu button 2 (Play) to the game.
I actually use the same approach as Myx, I just wanted to show you a basic example with booleans before bringing in the state machines But the point is, you enable/disable blocks of GUI code with boolean or state switches.