Ejemplo n.º 1
0
        void LoadingQueue()
        {
            LinkedListNode <BackGroundQueue> fristNode = this.loadQueue.First;

            for (int i = 0; i < this.loadingCount - this.loadingTasks.Count; i++)
            {
                while (fristNode != null)
                {
                    BackGroundQueue value = fristNode.Value;
                    if (value.Count > 0)
                    {
                        var abInfo = value.Dequeue();
                        if (!loadingTasks.ContainsKey(abInfo))
                        {
                            RunningTask(abInfo, value);
                            break;
                        }
                    }
                    fristNode = fristNode.Next;
                    this.loadQueue.Remove(value);
                }
                if (fristNode == null)
                {
                    break;
                }
            }
        }
Ejemplo n.º 2
0
 void LoadingQueue()
 {
     lock (syncRoot) {
         LinkedListNode <BackGroundQueue> fristNode = this.loadQueue.First;
         #if UNITY_EDITOR
         Debug.LogFormat("LoadingQueue.count={0},fristNode={1},canload={2},frame={3}", loadQueue.Count, fristNode, this.loadingCount - this.loadingTasks.Count > 0, Time.frameCount);
         #endif
         while (fristNode != null && this.loadingCount - this.loadingTasks.Count > 0)
         {
             BackGroundQueue value = fristNode.Value;
         #if UNITY_EDITOR
             Debug.LogFormat("BackGroundQueue.Count={0},LoadingQueue.count={1},loading={2},frame={3}", value.Count, loadQueue.Count, this.loadingCount - this.loadingTasks.Count, Time.frameCount);
         #endif
             if (value.Count > 0)
             {
                 var abInfo = value.Dequeue();
                 if (!loadingTasks.ContainsKey(abInfo))
                 {
                     RunningTask(abInfo, value);
                 }
             }
             else
             {
                 fristNode = fristNode.Next;
                 this.loadQueue.Remove(value);
             }
         }
     }
 }
Ejemplo n.º 3
0
        void LoadingQueue()
        {
            lock (syncRoot) {
                LinkedListNode <BackGroundQueue> fristNode = this.loadQueue.First;

                while (fristNode != null && this.loadingCount - this.loadingTasks.Count > 0)
                {
                    BackGroundQueue value = fristNode.Value;
                    if (value.Count > 0)
                    {
                        var abInfo = value.Dequeue();
                        if (!loadingTasks.ContainsKey(abInfo))
                        {
                            RunningTask(abInfo, value);
                        }
                    }
                    else
                    {
                        fristNode = fristNode.Next;
                        this.loadQueue.Remove(value);
                    }
                }
            }
        }