/// <summary> /// 移除已注册的状态机 /// </summary> /// <param name="fsm">状态机</param> public void UnRegisterFSM(FSM fsm) { if (FSMs.ContainsKey(fsm.Name)) { FSMs.Remove(fsm.Name); if (FSMGroups.ContainsKey(fsm.Group)) { FSMGroups[fsm.Group].Remove(fsm); } } else { throw new HTFrameworkException(HTFrameworkModule.FSM, "移除已注册的状态机失败:不存在状态机 " + fsm.Name + " !"); } }
/// <summary> /// 移除已注册的状态机 /// </summary> /// <param name="fsm">状态机</param> public void UnRegisterFSM(FSM fsm) { if (fsm == null) { return; } if (FSMs.ContainsKey(fsm.Name)) { FSMs.Remove(fsm.Name); if (FSMGroups.ContainsKey(fsm.Group)) { FSMGroups[fsm.Group].Remove(fsm); } } else { Log.Warning("移除已注册的状态机失败:不存在状态机 " + fsm.Name + " !"); } }