public IModule GetModule(CFModule moduleType) { string moduleName = moduleType.ToString(); if (moduleMap.ContainsKey(moduleName)) { return(moduleMap[moduleName]); } else { Utility.DebugError("Can't get module: \t" + moduleName); return(null); } }
/// <summary> /// 注册模块 /// </summary> /// <param name="moduleType"></param> /// <param name="module"></param> public void RegisterModule(CFModule moduleType, IModule module) { string moduleName = moduleType.ToString(); if (!moduleMap.ContainsKey(moduleName)) { moduleMap.Add(moduleName, module); moduleCount++; } else { Utility.DebugError("module \t" + moduleName + "is already exist!"); } }
/// <summary> /// 注销模块 /// </summary> /// <param name="moduleType"></param> public void DeregisterModule(CFModule moduleType) { string moduleName = moduleType.ToString(); if (moduleMap.ContainsKey(moduleName)) { moduleMap[moduleName].DeregisterModule(); moduleMap.Remove(moduleName); moduleCount--; } else { Utility.DebugError("module \t" + moduleName + " is not exist!"); } }
void RegisterModule() { GameManager.Instance.RegisterModule(moduleID, this); Utility.DebugLog("Module:\"" + moduleID.ToString() + "Manager\"" + " is registered !" + "\n based on Module register function"); }