Beispiel #1
0
        public override StateMachineComponentBase Evaluate()
        {
            var nextState = base.Evaluate();

            if (nextState != this)
            {
                return(nextState);
            }

            var newState = currentState.Evaluate();

            if (newState != currentState)
            {
                currentState = newState;
                currentState.OnEnter();
            }

            return(this);
        }
Beispiel #2
0
 public override void OnEnter()
 {
     // Initialise the default state.
     currentState = GetState(EntryStateName);
     currentState.OnEnter();
 }