/// <summary> /// check the queue and load assetbundle and asset /// </summary> static protected bool LoadingQueue() { if (inProgressBundleOperations.Count > 0) { return(false); //wait bundle load } LinkedListNode <BundleGroundQueue> fristNode = bundleGroundQueue.First; while (fristNode != null && maxLoading - loadingTasks.Count > 0) { BundleGroundQueue value = fristNode.Value; if (value.Count > 0) { var req = value.Dequeue(); #if HUGULA_LOADER_DEBUG HugulaDebug.FilterLogFormat("LoadingQueue", "<color=#05AA01>0.1 LoadAssetBundle Request(url={0},assetname={1},dependencies.count={3})keyHashCode{2}, frameCount{4}</color>", req.url, req.assetName, req.keyHashCode, req.dependencies == null ? 0 : req.dependencies.Length, Time.frameCount); #endif LoadAssetBundle(req); } else { fristNode = fristNode.Next; bundleGroundQueue.Remove(value); } var ts = System.DateTime.Now - frameBegin; if (ts.TotalMilliseconds > BundleLoadBreakMilliSeconds) { return(true); } } return(false); }
/// <summary> /// load group request /// </summary> /// <param name="bGroup"></param> static public void LoadGroupAsset(BundleGroundQueue bGroup) { while (bGroup != null && bGroup.Count > 0) { var req = bGroup.Dequeue(); LoadAsset(req); } }