Game State
Last Update: June 20, 2022
This is intended to provide a simple state system for the overall operation of the game levels. Does not apply to the menu screen, is only for "Playing the game" scenes.
Game States
I've included five states, three of which are active during game play. As of this writing nothing actually happens in Preloading, but I've added it just in case. Similarly, the only thing that will happen in "Closing", will be application quit or loading the main menu.
The other states are perhaps self explanatory.

GameState (Events)
The GameState class will send out all of the events, and will be the one class which handles transitioning from one state to another. Here is a selection from the script.
LegendMonoBehaviour
Any class which relies on states will be a LegendMonoBehaviour, which is just a MonoBehaviour, which has these methods.
Example Use
This is from Game.cs, the main "Game" class, which acts as a hub for a lot of the other classes. The AwakeSetup() method is called in Awake(), and comes after the SubscribeToEvents method on LegendMonoBehaviour.
Last updated