DispatchComplete() public method

public DispatchComplete ( ) : void
return void
Ejemplo n.º 1
0
        /// <summary>
        /// dispatch request event
        /// </summary>
        /// <param name="req"></param>
        /// <param name="isError"></param>
        static internal void DispatchReqAssetOperation(CRequest req, bool isError, int opID, bool backPool = true)
        {
            currLoaded++;

            OnProcess();
            try
            {
                if (isError)
                {
                    req.DispatchEnd();
                }
                else if (opID == 0 || completeOper.Contains(opID)) //正常回调
                {
                    completeOper.Remove(opID);
                    req.DispatchComplete();
                }
                else
                {
                    req.DispatchEnd();
                }
            }
            catch (System.Exception e)
            {
                Debug.LogError(e);
            }

            if (backPool)
            {
                req.ReleaseToPool();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// dispatch request event
        /// </summary>
        /// <param name="req"></param>
        /// <param name="isError"></param>
        static internal void DispatchReqAssetOperation(CRequest req, bool isError)
        {
            var group = req.group;

            currLoaded++;

            OnProcess();
            try {
                if (isError)
                {
                    req.DispatchEnd();
                }
                else
                {
                    req.DispatchComplete();
                }
            } catch (System.Exception e) {
                Debug.LogError(e);
            }

            if (group != null)
            {
                group.Complete(req, isError);
            }

            req.ReleaseToPool();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// dispatch request event
        /// </summary>
        /// <param name="req"></param>
        /// <param name="isError"></param>
        static internal void DispatchReqAssetOperation(CRequest req, bool isError)
        {
            var group = req.group;

            if (isError)
            {
                req.DispatchEnd();
            }
            else
            {
                req.DispatchComplete();
            }

            if (group != null)
            {
                group.Complete(req, isError);
            }
#if HUGULA_PROFILER_DEBUG && !HUGULA_NO_LOG
            var now = System.DateTime.Now;
            var dt1 = now - req.beginQueueTime;
            var dt2 = now - req.beginLoadTime;
            Debug.LogFormat("<color=#0a9a0a>asset complete Request(asset={0},key={1}) alltime={2},loadtime={3};frame={4}</color>", req.assetName, req.key, dt1.TotalSeconds, dt2.TotalSeconds, Time.frameCount);
#endif

            req.ReleaseToPool();
        }
Ejemplo n.º 4
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();
        }
Ejemplo n.º 5
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);
            }
        }
Ejemplo n.º 6
0
 static public int DispatchComplete(IntPtr l)
 {
     try {
         Hugula.Loader.CRequest self = (Hugula.Loader.CRequest)checkSelf(l);
         self.DispatchComplete();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 7
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);
            }
        }
Ejemplo n.º 8
0
 protected static void LoadAssetComplate(CRequest req)
 {
     currentLoaded++;
     PopGroup(req);
     ClearNoABCache(req);
     try
     {
         req.DispatchComplete();
     }
     catch { }
     BeginQueue();
     CheckAllComplete();
 }