Пример #1
0
        public void SetState(Enum state)
        {
            if (_currentState.exitAction != null)
            {
                _currentState.exitAction(_owner);
            }

            _currentState = _states[state];

            if (_currentState.enterAction != null)
            {
                _currentState.enterAction(_owner);
            }
        }
Пример #2
0
        public void ChangeState(Enum state)
        {
            if (m_currentState.exitAction != null)
            {
                m_currentState.exitAction();
            }

            m_currentStateID = state;
            m_currentState   = _states[state];

            if (m_currentState.enterAction != null)
            {
                m_currentState.enterAction();
            }
        }