public void unloadModule(ModuleID moduleID) { if (ModuleID.LOGINMN == moduleID) { if (Ctx.m_instance.m_loginSys != null) { Ctx.m_instance.m_loginSys.unload(); } } else if (ModuleID.AUTOUPDATEMN == moduleID) { if (Ctx.m_instance.m_autoUpdate != null) { Ctx.m_instance.m_autoUpdate.unload(); } } if (Ctx.m_instance.m_layerMgr.m_path2Go.ContainsKey(m_type2ItemDic[moduleID].m_moduleLayerPath)) { UtilApi.Destroy(Ctx.m_instance.m_layerMgr.m_path2Go[m_type2ItemDic[moduleID].m_moduleLayerPath]); } else { Ctx.m_instance.m_logSys.log("没有找到卸载的模块的 object"); } Ctx.m_instance.m_layerMgr.m_path2Go.Remove(m_type2ItemDic[moduleID].m_moduleLayerPath); UtilApi.UnloadUnusedAssets(); }
protected void unloadScene() { if (null != m_scene) { //Ctx.m_instance.m_resLoadMgr.unload(m_scene.file); UtilApi.UnloadUnusedAssets(); // 卸载共享资源 } }
public override void unload() { if (m_go != null) { //UtilApi.UnloadAsset(m_go); // 强制卸载资源数据 //UtilApi.DestroyImmediate(m_go, true); UtilApi.UnloadUnusedAssets(); m_go = null; } m_retGO = null; base.unload(); }
protected void exitFormInternal(UIFormID ID) { Form win = getForm(ID); if (win != null) { // 清理列表 UILayer layer = win.uiLayer; layer.winDic.Remove(ID); // 释放界面资源 win.onExit(); UtilApi.Destroy(win.m_GUIWin.m_uiRoot); win.m_GUIWin.m_uiRoot = null; // 释放加载的资源 //string path = m_UIAttrs.getPath(ID); //if (path != null) //{ // Ctx.m_instance.m_resLoadMgr.unload(path); //} UtilApi.UnloadUnusedAssets(); // 异步卸载共用资源 m_id2FormDic.Remove(ID); win = null; } }