Exemple #1
0
        /// <summary>
        /// 停止资源加载
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="destroyIfIsInstnace"></param>
        internal void UnloadAssetAsync(AssetHandler handler, bool destroyIfIsInstnace)
        {
            //判断需要停止的是否还尚未开始加载
            if (dataWaitingQueue.Count > 0)
            {
                foreach (var data in dataWaitingQueue)
                {
                    if (data.Handler == handler)
                    {
                        dataWaitingQueue.Remove(data);
                        dataPool.Release(data);
                        return;
                    }
                }
            }

            if (dataLoadingList.Count > 0)
            {
                foreach (var data in dataLoadingList)
                {
                    if (data.Handler == handler)
                    {
                        data.DoCancel(destroyIfIsInstnace);
                        return;
                    }
                }
            }
        }
Exemple #2
0
 public void Remove(T item)
 {
     try
     {
         queue.Remove(GetExistingNode(item));
     }
     catch (InvalidOperationException ex)
     {
         throw new InvalidOperationException("Cannot call Remove () on a node which is not enqueued: " + item, ex);
     }
 }