private void CreateTriggerObject(FSMTriggerID triggerID) {//反射 Type type = Type.GetType("AI.FSM." + triggerID + "Trigger"); FSMTrigger obj = Activator.CreateInstance(type) as FSMTrigger; Triggers.Add(obj); }
private void CreateTrigger(FSMTriggerID triggerID) { //反射获取类型 Type type = Type.GetType("AI.FSM." + triggerID + "Trigger"); FSMTrigger trigger = Activator.CreateInstance(type) as FSMTrigger; Triggers.Add(trigger); }
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); }