コード例 #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
ファイル: StateMachine.cs プロジェクト: tromagon/Gonity
        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();
            }
        }