示例#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);
        }