private void ChangeState(OTGCombatState _newState, bool _usePrevious = false) { if (_usePrevious && m_previousState != null) { m_currentState.OnStateExit(this); m_currentState = m_previousState; m_currentState.OnStateEnter(this, true); m_previousState = null; return; } if (m_currentState != null) { m_currentState.OnStateExit(this); } m_previousState = m_currentState; m_currentState = _newState; m_currentState.OnStateEnter(this); }
public void OnChangeStateRequested(OTGCombatState _newState, bool _usePrevious = false) { ChangeState(_newState, _usePrevious); }