public void onTexLoadEventHandle(IDispatchObject dispObj) { m_texRes = dispObj as TextureRes; GameObject go_ = UtilApi.TransFindChildByPObjAndPath(m_selfGo, "25e9d638.obj"); #if UNITY_5 go_.GetComponent <Renderer>().material.mainTexture = m_texRes.getTexture(); #elif UNITY_4_6 || UNITY_4_5 go_.renderer.material.mainTexture = m_texRes.getTexture(); #endif }
public void syncUpdateTex() { if (m_bNeedReloadTex) { if (m_texRes != null) { Ctx.m_instance.m_texMgr.unload(m_texRes.GetPath(), null); m_texRes = null; } m_texRes = Ctx.m_instance.m_texMgr.getAndSyncLoad <TextureRes>(m_texPath); m_mat.mainTexture = m_texRes.getTexture(); } else if (m_bModelChanged) { if (m_texRes == null) { m_texRes = Ctx.m_instance.m_texMgr.getAndSyncLoad <TextureRes>(m_texPath); } m_mat.mainTexture = m_texRes.getTexture(); } m_bNeedReloadTex = false; m_bModelChanged = false; }
public void syncUpdateTex() { if(m_bNeedReloadTex) { if (m_texRes != null) { Ctx.m_instance.m_texMgr.unload(m_texRes.GetPath(), null); m_texRes = null; } m_texRes = Ctx.m_instance.m_texMgr.getAndSyncLoad<TextureRes>(m_texPath); m_mat.mainTexture = m_texRes.getTexture(); } else if (m_bModelChanged) { if (m_texRes == null) { m_texRes = Ctx.m_instance.m_texMgr.getAndSyncLoad<TextureRes>(m_texPath); } m_mat.mainTexture = m_texRes.getTexture(); } m_bNeedReloadTex = false; m_bModelChanged = false; }
public void onTexLoadEventHandle(IDispatchObject dispObj) { m_texRes = dispObj as TextureRes; GameObject go_ = UtilApi.TransFindChildByPObjAndPath(m_selfGo, "25e9d638.obj"); #if UNITY_5 go_.GetComponent<Renderer>().material.mainTexture = m_texRes.getTexture(); #elif UNITY_4_6 || UNITY_4_5 go_.renderer.material.mainTexture = m_texRes.getTexture(); #endif }