public void ReqStateChange(REnvState nextState) { if (_curStateEntity != null) { _curStateEntity.Dispose(); _curStateEntity = null; } _curStateName = nextState; _curStateEntity = _stateFactoryRE.CreateState(nextState); _curStateEntity.Start(); }