Beispiel #1
0
        protected virtual void Transition(StateEUE value)
        {
            if (_currentState == value || _inTransition)
            {
                return;
            }

            _inTransition = true;

            if (_currentState != null)
            {
                _currentState.Exit();
            }

            _currentState = value;

            if (_currentState != null)
            {
                _currentState.Enter();
            }

            _inTransition = false;
        }
Beispiel #2
0
 public virtual void ChangeState <T>() where T : StateEUE
 {
     CurrentState = GetState <T>();
     stateName    = CurrentState.stateName;
 }