Exemplo n.º 1
0
        protected virtual void Transition(MonoState value)
        {
            if (currentState == value || inTransition)
            {
                return;
            }

            inTransition = true;

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

            currentState = value;

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

            inTransition = false;

            currentState.AfterTransition();
        }
Exemplo n.º 2
0
 public virtual void ChangeState <T>() where T : MonoState
 {
     CurrentState = GetState <T>();
 }
Exemplo n.º 3
0
 protected virtual void Start()
 {
     this.CurrentState = firstState;
 }