private void ProcessStateSwitch() { if (!stateIsSwitching) { return; } stateIsSwitching = false; state?.OnExit(); state = newState; state.OnEnter(); AIStateChanged?.Invoke(state); }
private void AddToStack(PersonalAIState state) { stateStack.Push(state); }
public void AddToStackAndSwitchTo(PersonalAIState state) { AddToStack(state); SwitchState(stateStack.Peek()); }
public void OnAIStateChanged(PersonalAIState state) { SetStatus(state.ToString()); }