public void ChangeState(string stateName) { if (currentState != null) { currentState.Exit(); } currentState = stateDictionary[stateName]; currentState.Enter(); }