Hello Unity Community,
I have spent my last 2 weeks worth of free time working on my unity project. Specifically, trying to implement a state management system for my game. I am trying to make a way for easy switching of Title Screen, Main Menu, Game Play, Level Select screen, etc. I have read just about every link on google for topics like “Unity3d game management”, “Unity3d game states” etc. I have not found a good way that I am satisfied with yet. I spent some time researching before posting here, but now after finding nothing concreted, I figured I would ask the community.
The only real solid information I could find that was almost complete were similar to these two methods:
Global GameObject that persists through scene transitions and implements a singleton pattern. Something like GameManager and has a function for ChangeState(GameState newState).
This sounds great, only it gets large fast. I was not able to find a great example of how to handle drawing each screen, actually handling different scenes, etc. This example doesn’t necessarily use separate scenes for each state e.g. MainMenuScene, GamePlayScene, etc.
The next method I found is like above, but using separate scenes where an object in the scene has scrips attached to it for drawing the GUI. This makes the most sense to me and is probably the easier to implement, but its got some other limitations im not satisfied with.
How are you handling Game state management and different screens and menus, and interactions between them? I am having a hard time with this, mainly because of the component/gameObject pattern in Unity. It is a bit of a change from I used to coming from XNA.
Any suggestions, examples, advice would be amazing. Please be as specific as you can. The basics are great, but think bigger.
Thanks!