Exemplo n.º 1
0
        // 资源改变更新图像
        protected void updateImage()
        {
            if (m_bNeedUpdateImage)
            {
                if (m_imageItem != null)
                {
                    Ctx.m_instance.m_atlasMgr.unloadImage(m_imageItem, null);
                    m_imageItem = null;
                }
                m_imageItem = Ctx.m_instance.m_atlasMgr.getAndSyncLoadImage(m_atlasName, m_imageName);
                m_imageItem.setImageImage(m_image);
            }
            else if (m_bImageGoChange)
            {
                if (m_imageItem == null)
                {
                    m_imageItem = Ctx.m_instance.m_atlasMgr.getAndSyncLoadImage(m_atlasName, m_imageName);
                }
                m_imageItem.setImageImage(m_image);
            }

            m_bImageGoChange   = false;
            m_bNeedUpdateImage = false;
        }
Exemplo n.º 2
0
        // 资源改变更新图像
        protected void updateImage()
        {
            if (m_bNeedUpdateImage)
            {
                if (m_imageItem != null)
                {
                    Ctx.m_instance.m_atlasMgr.unloadImage(m_imageItem, null);
                    m_imageItem = null;
                }
                m_imageItem = Ctx.m_instance.m_atlasMgr.getAndSyncLoadImage(m_atlasName, m_imageName);
                m_imageItem.setImageImage(m_image);
            }
            else if (m_bImageGoChange)
            {
                if (m_imageItem == null)
                {
                    m_imageItem = Ctx.m_instance.m_atlasMgr.getAndSyncLoadImage(m_atlasName, m_imageName);
                }
                m_imageItem.setImageImage(m_image);
            }

            m_bImageGoChange = false;
            m_bNeedUpdateImage = false;
        }
Exemplo n.º 3
0
 override public void dispose()
 {
     base.dispose();
     if (m_imageItem != null)
     {
         Ctx.m_instance.m_atlasMgr.unloadImage(m_imageItem, null);
         m_imageItem = null;
     }
 }
Exemplo n.º 4
0
 protected ImageItem createImage(string spriteName, ResLoadState resLoadState)
 {
     m_path2Image[spriteName] = new ImageItem();
     m_path2Image[spriteName].atlasScriptRes = this;
     m_path2Image[spriteName].spriteName = spriteName;
     m_path2Image[spriteName].refCountResLoadResultNotify.resLoadState.copyFrom(resLoadState);
     return m_path2Image[spriteName];
 }
Exemplo n.º 5
0
 // 暂时没有实现
 public void unloadImage(ImageItem imageItem, Action<IDispatchObject> loadEventHandle)
 {
     if (imageItem != null && imageItem.atlasScriptRes != null)
     {
         unloadImage(imageItem.atlasScriptRes.GetPath(), imageItem.spriteName, loadEventHandle);
     }
     else
     {
         Ctx.m_instance.m_logSys.log("Unload Null ImageItem");
     }
 }