Пример #1
0
        public void loadImage(LoadParam param)
        {
            ImageItem retImage = null;

            if (!m_path2Image.ContainsKey(param.m_subPath))
            {
                retImage       = createImage(param.m_subPath, refCountResLoadResultNotify.resLoadState);
                retImage.image = getSprite(param.m_subPath);
            }
            else
            {
                retImage = m_path2Image[param.m_subPath];
            }
            retImage.refCountResLoadResultNotify.resLoadState.setLoading();
            retImage.refCountResLoadResultNotify.refCount.incRef();

            if (refCountResLoadResultNotify.resLoadState.hasLoaded())
            {
                if (param.m_loadEventHandle != null)
                {
                    param.m_loadEventHandle(retImage);
                }
            }
            else if (refCountResLoadResultNotify.resLoadState.hasNotLoadOrLoading())
            {
                if (param.m_loadEventHandle != null)
                {
                    retImage.refCountResLoadResultNotify.loadResEventDispatch.addEventHandle(param.m_loadEventHandle);
                }
            }
        }
Пример #2
0
 protected void loadWithResCreatedAndLoad(LoadParam param)
 {
     m_path2ResDic[param.m_path].refCountResLoadResultNotify.refCount.incRef();
     if (m_path2ResDic[param.m_path].refCountResLoadResultNotify.resLoadState.hasLoaded())
     {
         if (param.m_loadEventHandle != null)
         {
             param.m_loadEventHandle(m_path2ResDic[param.m_path]);        // 直接通知上层完成加载
         }
     }
     else
     {
         if (param.m_loadEventHandle != null)
         {
             m_path2ResDic[param.m_path].refCountResLoadResultNotify.loadResEventDispatch.addEventHandle(param.m_loadEventHandle);
         }
     }
 }
Пример #3
0
        // 资源创建并且正在被加载
        protected void loadWithResCreatedAndLoad(LoadParam param)
        {
            m_LoadData.m_path2Res[param.m_path].refCountResLoadResultNotify.refCount.incRef();
            if (m_LoadData.m_path2Res[param.m_path].refCountResLoadResultNotify.resLoadState.hasLoaded())
            {
                if (param.m_loadEventHandle != null)
                {
                    param.m_loadEventHandle(m_LoadData.m_path2Res[param.m_path]);
                }
            }
            else
            {
                if (param.m_loadEventHandle != null)
                {
                    m_LoadData.m_path2Res[param.m_path].refCountResLoadResultNotify.loadResEventDispatch.addEventHandle(param.m_loadEventHandle);
                }
            }

            resetLoadParam(param);
        }
Пример #4
0
        public void loadImage(LoadParam param)
        {
            ImageItem retImage = null;
            if (!m_path2Image.ContainsKey(param.m_subPath))
            {
                retImage = createImage(param.m_subPath, refCountResLoadResultNotify.resLoadState);
                retImage.image = getSprite(param.m_subPath);
            }
            else
            {
                retImage = m_path2Image[param.m_subPath];
            }
            retImage.refCountResLoadResultNotify.resLoadState.setLoading();
            retImage.refCountResLoadResultNotify.refCount.incRef();

            if (refCountResLoadResultNotify.resLoadState.hasLoaded())
            {
                if (param.m_loadEventHandle != null)
                {
                    param.m_loadEventHandle(retImage);
                }
            }
            else if (refCountResLoadResultNotify.resLoadState.hasNotLoadOrLoading())
            {
                if (param.m_loadEventHandle != null)
                {
                    retImage.refCountResLoadResultNotify.loadResEventDispatch.addEventHandle(param.m_loadEventHandle);
                }
            }
        }