/// <summary> /// 注册状态机 /// </summary> /// <param name="fsm">状态机</param> public void RegisterFSM(FSM fsm) { if (!FSMs.ContainsKey(fsm.Name)) { FSMs.Add(fsm.Name, fsm); if (FSMGroups.ContainsKey(fsm.Group)) { FSMGroups[fsm.Group].Add(fsm); } else { FSMGroups.Add(fsm.Group, new List <FSM>()); FSMGroups[fsm.Group].Add(fsm); } } else { throw new HTFrameworkException(HTFrameworkModule.FSM, "注册状态机失败:已存在状态机 " + fsm.Name + " !"); } }
/// <summary> /// 移除已注册的状态机 /// </summary> /// <param name="fsm">状态机</param> public void UnRegisterFSM(FSM fsm) { _helper.UnRegisterFSM(fsm); }
/// <summary> /// 注册状态机 /// </summary> /// <param name="fsm">状态机</param> public void RegisterFSM(FSM fsm) { _helper.RegisterFSM(fsm); }
private void OnEnable() { _target = target as FSM; }