SetAssetLoaded() static private method

Sets the asset loaded.
static private SetAssetLoaded ( int hashkey ) : void
hashkey int Hashkey.
return void
示例#1
0
        private static void DispatchReqComplete(CRequest reqitem)
        {
            if (reqitem.isShared)
            {
                CountMananger.Add(reqitem.keyHashCode);
                CountMananger.AddDependencies(reqitem.keyHashCode);
                if (_instance && _instance.OnSharedComplete != null)
                {
                    _instance.OnSharedComplete(reqitem);
                }

                CacheManager.SetAssetLoaded(reqitem.keyHashCode);
                if (reqitem.pool)
                {
                    LRequestPool.Release(reqitem);
                }
            }
            else
            {
                if (reqitem.assetBundleRequest != null)
                {
                    CacheManager.RemoveLock(reqitem.keyHashCode);
                }
                reqitem.DispatchComplete();
                PopGroup(reqitem);
            }
        }
示例#2
0
        protected static void LoadAssetComplate(CRequest req)
        {
                        #if HUGULA_LOADER_DEBUG
            Debug.LogFormat(" 6. <color=yellow>LoadAssetComplate Req(assetname={0},url={1}) frameCount{2}</color>", req.assetName, req.url, Time.frameCount);
                        #endif
            if (req.isShared)
            {
                CountMananger.Add(req.keyHashCode);
                CountMananger.AddDependencies(req.keyHashCode);
                if (_instance && _instance.OnSharedComplete != null)
                {
                    _instance.OnSharedComplete(req);
                }

                CacheManager.SetAssetLoaded(req.keyHashCode);
                if (req.pool)
                {
                    LRequestPool.Release(req);
                }
            }
            else
            {
                if (req.assetBundleRequest != null)
                {
                    CacheManager.RemoveLock(req.keyHashCode);
                }
                req.DispatchComplete();
                PopGroup(req);
            }
            BeginQueue();
            CheckAllComplete();
        }
示例#3
0
        // assetbunldle loaddown complete
        protected static void CallbackAsyncList(CRequest creq)
        {
            List <CRequest> callbacklist = null;// requestCallBackList[creq.udKey];
            string          udkey        = creq.udKey;

            if (!creq.isShared)
            {
                CacheManager.SetAssetLoaded(creq.keyHashCode);
            }

            if (requestCallBackList.TryGetValue(udkey, out callbacklist))
            {
                requestCallBackList.Remove(udkey);
                int      count = callbacklist.Count;
                CRequest reqitem;
                for (int i = 0; i < count; i++)
                {
                    reqitem = callbacklist[i];

                    if (!creq.isAssetBundle)                       //如果加载的不是assetbundle
                    {
                        reqitem.data = creq.data;
                        loadedAssetQueue.Enqueue(reqitem);
                                                #if HUGULA_LOADER_DEBUG
                        Debug.LogFormat("2.1.0 <color=#15C132>  Add all to loadedAssetQueue Req(assetname={0},url={1} )frame={2} count={3}  </color>", creq.assetName, creq.url, Time.frameCount, count);
                                                #endif
                    }
                    else                         // if (!creq.isShared) { //非共享资源需要回调
                                                 //loadingAssetBundleQueue.Add (reqitem);
                    {
                        AddReqToAssetCallBackList(reqitem);
                                                #if HUGULA_LOADER_DEBUG
                        Debug.LogFormat("2.1.0 <color=#15C132>  Add all to loadingAssetBundleQueue Req(assetname={0},url={1}) frame={2} count = {3} </color>", creq.assetName, creq.url, Time.frameCount, count);
                                                #endif
                    }
                }
                ListPool <CRequest> .Release(callbacklist);
            }
            else
            {
                if (!creq.isAssetBundle)                 //r如果不是assetbundle不需要load asset
                {
                    loadedAssetQueue.Enqueue(creq);
                    #if HUGULA_LOADER_DEBUG
                    Debug.LogFormat("2.1.1 <color=#15C132> Add one to loadingAssetBundleQueue Req(assetname={0},url={1}) frame={2} </color>", creq.assetName, creq.url, Time.frameCount);
                    #endif
                }
                else
                {
                    // loadingAssetBundleQueue.Add(creq);
                    AddReqToAssetCallBackList(creq);
                    #if HUGULA_LOADER_DEBUG
                    Debug.LogFormat("2.1.1 <color=#15C132> Add one to loadingAssetBundleQueue Req(assetname={0},url={1}) frame={2} </color>", creq.assetName, creq.url, Time.frameCount);
                    #endif
                }
            }
        }
示例#4
0
        /// <summary>
        /// dispatch request complete event
        /// </summary>
        /// <param name="req"></param>
        private static void DispatchReqComplete(CRequest reqitem)
        {
            if (reqitem.isShared)
            {
                CacheManager.SetAssetLoaded(reqitem.keyHashCode);
                if (_instance && _instance.OnSharedComplete != null)
                {
                    _instance.OnSharedComplete(reqitem);
                }

                if (reqitem.pool)
                {
                    LRequest.Release(reqitem);
                }
            }
            else
            {
                reqitem.DispatchComplete();
                PopGroup(reqitem);
            }
        }