示例#1
0
        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);
        }
示例#2
0
 public void OnChangeStateRequested(OTGCombatState _newState, bool _usePrevious = false)
 {
     ChangeState(_newState, _usePrevious);
 }