예제 #1
0
파일: FSMState.cs 프로젝트: a100q100/FSM
        private void CreateTriggerObject(FSMTriggerID triggerID)
        {//反射
            Type       type = Type.GetType("AI.FSM." + triggerID + "Trigger");
            FSMTrigger obj  = Activator.CreateInstance(type) as FSMTrigger;

            Triggers.Add(obj);
        }
예제 #2
0
        private void CreateTrigger(FSMTriggerID triggerID)
        {
            //反射获取类型
            Type       type    = Type.GetType("AI.FSM." + triggerID + "Trigger");
            FSMTrigger trigger = Activator.CreateInstance(type) as FSMTrigger;

            Triggers.Add(trigger);
        }
예제 #3
0
        private void CreateTriggerObject(FSMTriggerID triggerID)
        {
            //创建条件对象
            //命名规范:"AI.FSM" + 条件枚举 + "Trigger"
            Type       type    = Type.GetType("AI.FSM." + triggerID + "Trigger");
            FSMTrigger trigger = Activator.CreateInstance(type) as FSMTrigger;

            triggers.Add(trigger);
        }