setState

Sets the state of the game to the state with the given class. If a state with the given class cannot be found, an exception is thrown.

When a state is switched, all event handlers of the previous state will be unregistered and become unresponsive to game events. The new state will take over and receive new game events.

If the previous state was a VitalCountdownTask or VitalRepeatableTask, the respective VitalCountdownTask.stop and VitalRepeatableTask.stop functions are called. Upon previous state unregistration, the VitalGlobalMinigameState.onDisable function is called, the new state's VitalGlobalMinigameState.onEnable function is called.


Sets the state of the game to the given state.

When a state is switched, all event handlers of the previous state will be unregistered and become unresponsive to game events. The new state will take over and receive new game events.

If the previous state was a VitalCountdownTask or VitalRepeatableTask, the respective VitalCountdownTask.stop and VitalRepeatableTask.stop functions are called. Upon previous state unregistration, the VitalGlobalMinigameState.onDisable function is called, the new state's VitalGlobalMinigameState.onEnable function is called.