示例#1
0
    private void ProcessStateSwitch()
    {
        if (!stateIsSwitching)
        {
            return;
        }

        stateIsSwitching = false;
        state?.OnExit();
        state = newState;
        state.OnEnter();
        AIStateChanged?.Invoke(state);
    }
示例#2
0
 private void AddToStack(PersonalAIState state)
 {
     stateStack.Push(state);
 }
示例#3
0
 public void AddToStackAndSwitchTo(PersonalAIState state)
 {
     AddToStack(state);
     SwitchState(stateStack.Peek());
 }
示例#4
0
 public void OnAIStateChanged(PersonalAIState state)
 {
     SetStatus(state.ToString());
 }