public void ChangeState(GameplayState newState) { if (StateLookup == null) { CreateStateLookup(); } if (currentState != null) { currentState.End(); } currentGameplayState = newState.ToString(); currentState = StateLookup[newState]; currentState.Begin(); }
string ToString() { return(stateName.ToString()); }