public void dispose() { if (m_modelRes != null) { Ctx.m_instance.m_modelMgr.unload(m_modelRes.GetPath(), onSubModelLoaded); m_modelRes = null; } if (m_skinRes != null) { Ctx.m_instance.m_modelMgr.unload(m_skinRes.GetPath(), onSubModelLoaded); m_skinRes = null; } }
public virtual void load() { bool needLoad = true; if (m_res != null) { if (m_res.GetPath() != m_path) { unload(); } else { needLoad = false; } } if (needLoad) { if (!string.IsNullOrEmpty(m_path)) { LoadParam param; param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); param.m_path = m_path; param.m_loadEventHandle = onLoadEventHandle; Ctx.m_instance.m_modelMgr.load <ModelRes>(param); Ctx.m_instance.m_poolSys.deleteObj(param); } } }
override public void dispose() { if (m_selfGo != null) { UtilApi.Destroy(m_selfGo); m_selfGo = null; } if (m_modelRes != null) { Ctx.m_instance.m_modelMgr.unload(m_modelRes.GetPath(), null); m_modelRes = null; } base.dispose(); }
protected void clearEffectRes() { if (m_selfGo != null) // 场景中的特效需要直接释放这个 GameObject { UtilApi.Destroy(m_selfGo); m_selfGo = null; m_spriteRender = null; } if (m_effectPrefab != null) { Ctx.m_instance.m_modelMgr.unload(m_effectPrefab.GetPath(), null); m_effectPrefab = null; } }
public void onSubModelLoaded(IDispatchObject dispObj) { ModelRes res = dispObj as ModelRes; Ctx.m_instance.m_logSys.logLoad(res); if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { if (m_skelRootGo != null) { linkSkelModel(); } } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { Ctx.m_instance.m_modelMgr.unload(res.GetPath(), onSubModelLoaded); m_modelRes = null; } }
override public void dispose() { if (m_model != null) { m_model.dispose(); m_model = null; } if (m_uiPrefabRes != null) { Ctx.m_instance.m_uiPrefabMgr.unload(m_uiPrefabRes.GetPath(), null); m_uiPrefabRes = null; } if (m_boxModel != null) { Ctx.m_instance.m_modelMgr.unload(m_boxModel.GetPath(), null); m_boxModel = null; } }
public virtual void onLoadEventHandle(IDispatchObject dispObj) { m_res = dispObj as ModelRes; if (m_res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, m_res.GetPath()); m_selfGo = m_res.InstantiateObject(m_path); m_selfGo.transform.SetParent(m_selfLocalGo.transform, false); // 不是使用 m_resLoadMgr.load 接口加载的资源,不要使用 m_resLoadMgr.unload 去卸载资源 // 卸载资源 //Ctx.m_instance.m_resLoadMgr.unload(m_res.GetPath()); } else if (m_res.refCountResLoadResultNotify.resLoadState.hasFailed()) { m_res = dispObj as ModelRes; Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem1, m_res.GetPath()); // 卸载资源 //Ctx.m_instance.m_resLoadMgr.unload(m_res.GetPath()); } }
public virtual void onLoadEventHandle(IDispatchObject dispObj) { m_res = dispObj as ModelRes; if (m_res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, m_res.GetPath()); m_selfGo = m_res.InstantiateObject(m_path); m_selfGo.transform.SetParent(m_selfLocalGo.transform, false); // 不是使用 m_resLoadMgr.load 接口加载的资源,不要使用 m_resLoadMgr.unload 去卸载资源 // 卸载资源 //Ctx.m_instance.m_resLoadMgr.unload(m_res.GetPath()); } else if (m_res.refCountResLoadResultNotify.resLoadState.hasFailed()) { m_res = dispObj as ModelRes; Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem1, m_res.GetPath()); // 卸载资源 //Ctx.m_instance.m_resLoadMgr.unload(m_res.GetPath()); } }