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 void loadSkin() { if (m_bNeedReloadSkin) { if (m_skinRes != null) { Ctx.m_instance.m_modelMgr.unload(m_skinRes.GetPath(), onSubModelLoaded); m_skinRes = null; } m_skinRes = Ctx.m_instance.m_modelMgr.getAndAsyncLoad <SkinRes>(m_skinPath, onSkinLoaded) as SkinRes; m_bNeedReloadSkin = false; } }
public void onSkinLoaded(IDispatchObject dispObj) { SkinRes res = dispObj as SkinRes; Ctx.m_instance.m_logSys.logLoad(res); if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded()) { if (m_skelRootGo != null) { if (m_modelGo != null) { UtilSkin.skinSkel(m_modelGo, m_skelRootGo, m_skinRes.boneArr); } } } else if (res.refCountResLoadResultNotify.resLoadState.hasFailed()) { Ctx.m_instance.m_modelMgr.unload(res.GetPath(), onSkinLoaded); m_skinRes = null; } }
public void loadSkin() { if (m_bNeedReloadSkin) { if (m_skinRes != null) { Ctx.m_instance.m_modelMgr.unload(m_skinRes.GetPath(), onSubModelLoaded); m_skinRes = null; } m_skinRes = Ctx.m_instance.m_modelMgr.getAndAsyncLoad<SkinRes>(m_skinPath, onSkinLoaded) as SkinRes; m_bNeedReloadSkin = false; } }