public void SwitchToPreviousState() { if (previousState != null) { currentState.StateExit(); currentState = previousState; currentState.StateEnter(); } }
public void ChangeState(IGameEventState newState) { if (currentState != null) { previousState = currentState; currentState.StateExit(); } currentState = newState; currentState.StateEnter(); }
//test public void RequestNewState(IGameEventState newstate) { gameEventStateMachine.ChangeState(newstate); }