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(); }
public void MoveToState(EAIState pendingState) { if (_availiableStates[pendingState] != null) { _currentState.OnLeave(); _currentState = _availiableStates[pendingState]; _currentState.OnEnter(); } }