コード例 #1
0
        protected virtual void OnEnable()
        {
            Debug.Assert(BaseState >= 0, this.name + " did not have a base state ID. CRASH LOUDLY");

            _currentState = _availiableStates.Count >= 1 ? _availiableStates[BaseState] : _availiableStates[_availiableStates.Keys.First()];
            _currentState.OnEnter();
        }
コード例 #2
0
 public void MoveToState(EAIState pendingState)
 {
     if (_availiableStates[pendingState] != null)
     {
         _currentState.OnLeave();
         _currentState = _availiableStates[pendingState];
         _currentState.OnEnter();
     }
 }