Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 public void unloadTex()
 {
     if (m_selfGo != null)
     {
         Ctx.m_instance.m_texMgr.unload(m_texPath, onTexLoadEventHandle);
         m_texRes = null;
     }
 }
Ejemplo n.º 4
0
 override public void dispose()
 {
     base.dispose();
     if (m_texRes != null)
     {
         Ctx.m_instance.m_texMgr.unload(m_texRes.GetPath(), null);
         m_texRes = null;
     }
 }
Ejemplo n.º 5
0
        override public void dispose()
        {
            if (m_texRes != null)
            {
                Ctx.m_instance.m_texMgr.unload(m_texRes.GetPath(), null);
                m_texRes = null;
            }

            base.dispose();
        }
Ejemplo n.º 6
0
        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
        }
Ejemplo n.º 7
0
        override public void dispose()
        {
            base.dispose();

            if(m_selfTex != null)
            {
                Ctx.m_instance.m_texMgr.unload(m_selfTex.GetPath(), null);
                m_selfTex = null;
            }

            if (m_enemyTex != null)
            {
                Ctx.m_instance.m_texMgr.unload(m_enemyTex.GetPath(), null);
                m_enemyTex = null;
            }

            if (m_effect != null)
            {
                m_effect.dispose();
                m_effect = null;
            }
        }
Ejemplo n.º 8
0
        // 资源改变更新图像
        protected void updateImage()
        {
            if (m_bNeedUpdateImage)
            {
                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_texRes.setImageTex(m_image);
            }
            else if (m_bImageGoChange)
            {
                if (m_texRes == null)
                {
                    m_texRes = Ctx.m_instance.m_texMgr.getAndSyncLoad <TextureRes>(m_texPath);
                }
                m_texRes.setImageTex(m_image);
            }

            m_bImageGoChange   = false;
            m_bNeedUpdateImage = false;
        }
Ejemplo n.º 9
0
        // 资源改变更新图像
        protected void updateImage()
        {
            if (m_bNeedUpdateImage)
            {
                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_texRes.setImageTex(m_image);
            }
            else if (m_bImageGoChange)
            {
                if (m_texRes == null)
                {
                    m_texRes = Ctx.m_instance.m_texMgr.getAndSyncLoad<TextureRes>(m_texPath);
                }
                m_texRes.setImageTex(m_image);
            }

            m_bImageGoChange = false;
            m_bNeedUpdateImage = false;
        }
Ejemplo n.º 10
0
        // 显示[对方回合]
        public void enemyTurn()
        {
            if (m_enemyTex == null)
            {
                m_enemyTex = Ctx.m_instance.m_texMgr.getAndSyncLoad<TextureRes>("Image/Scene/duishou_zhanchang.tga");
            }

            m_mat.mainTexture = m_enemyTex.getTexture();
        }
Ejemplo n.º 11
0
        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
        }
Ejemplo n.º 12
0
 public void unloadTex()
 {
     if (m_selfGo != null)
     {
         Ctx.m_instance.m_texMgr.unload(m_texPath, onTexLoadEventHandle);
         m_texRes = null;
     }
 }