Beispiel #1
0
        private void Start()
        {
            //  yield return new WaitForSeconds(2f);

            m_FSMManager = GameBox.GetComponent <FSMComponent>(); //获取状态机管家组件
            m_IFSM       = m_FSMManager.CreateFSM("Demo");        //创建一个状态机
            m_IFSM.AddState <StateOne>();
            m_IFSM.AddState(typeof(StateTwo));
            m_IFSM.AddCondition <ConditionOne>();
            m_IFSM.AddCondition <ConditionTwo>();
            m_IFSM.ChangeState <StateOne>(); //初始状态
        }