示例#1
0
文件: BaseFSM.cs 项目: 772148702/mmd
        private void ChangeState(IState <T> nextState)
        {
            if (m_CurState != null)
            {
                m_CurState.OnExitState();
            }

            if (nextState != null)
            {
                m_CurState = nextState;
                m_CurState.OnEnterState();
            }
        }
示例#2
0
 /// <summary>
 /// 进行状态过渡
 /// </summary>
 /// <param name="transition"></param>
 private void DoTransition(ITransition transition)
 {
     _currentState.OnExitState();
     _currentState = transition.ToState;
     _currentState.OnEnterState();
 }