Exemple #1
0
 /// <summary>
 /// 移除模组包
 /// </summary>
 /// <param name="mod">模组包实例</param>
 /// <returns>返回操作是否成功</returns>
 public bool UnLoadGameMod(GameMod mod)
 {
     mod.Destroy();
     gameMods.Remove(mod);
     GameManager.GameMediator.DispatchGlobalEvent(GameEventNames.EVENT_MOD_UNLOAD, "*", mod.PackageName, mod);
     return(true);
 }
Exemple #2
0
        /// <summary>
        /// 移除模组包
        /// </summary>
        /// <param name="modUid">模组包UID</param>
        /// <returns>返回操作是否成功</returns>
        public bool UnLoadGameMod(string packageName)
        {
            GameMod mod = FindGameMod(packageName);

            if (mod == null)
            {
                GameLogger.Warning(TAG, "无法卸载模组 {0},因为没有加载", packageName);
                GameErrorManager.LastError = GameError.NotRegister;
                return(false);
            }

            mod.Destroy();
            gameMods.Remove(mod);
            GameManager.GameMediator.DispatchGlobalEvent(GameEventNames.EVENT_MOD_UNLOAD, "*", mod.PackageName, mod);

            return(true);
        }