public void UpdateTick() { if (_currentState != null) { var next = _currentState.ShoudExit(); if (next != null && next != _currentState.GetType()) { _currentState.OnExit(); _currentState = _fsmStates[next]; _currentState.OnEnter(); } _currentState.OnUpdate(); } }
public void Release() { SetExecute(false); m_CurState?.OnExit(); m_CurState = null; }