Esempio n. 1
0
        public void ChangeState(FSMState <EntityType, TransitionId> NewState)
        {
            if (m_CurrentState != NewState)
            {
                m_PreviousState = m_CurrentState;

                if (m_CurrentState != null)
                {
                    m_CurrentState.Exit();
                }

                m_CurrentState = NewState;

                if (m_CurrentState != null)
                {
                    m_CurrentState.Enter();
                }
            }
        }
Esempio n. 2
0
 /*设置全局状态*/
 public void SetGlobalState(FSMState <EntityType, TransitionId> globalState)
 {
     m_GlobalState = globalState;
     m_GlobalState.Enter();
 }
Esempio n. 3
0
 /*设置当前状态*/
 public void SetCurrentState(FSMState <EntityType, TransitionId> currentState)
 {
     m_CurrentState = currentState;
     m_CurrentState.Enter();
 }
Esempio n. 4
0
 /*进入全局状态*/
 public void GlobalStateEnter()
 {
     m_GlobalState.Enter();
 }