Example #1
0
 public void LoadError(SimpleLoader loader)
 {
     addError(loader.keyUrl);
     for (int i = 0; i < loadinglist.Count; i++)
     {
         if (loadinglist[i] == loader.keyUrl)
         {
             loadinglist.RemoveAt(i);
             for (int k = 0; k < waitingLoaderlist.Count; k++)
             {
                 SimpleLoader item = waitingLoaderlist[k];
                 if (item.keyUrl == loader.keyUrl)
                 {
                     //item.onloaded();
                     //item.progress = 1;
                     item.state = loader.state;
                     item.EndOnly();
                     waitingLoaderlist.RemoveAt(k);
                     k--;
                 }
             }
         }
     }
     MyCallLater.Add(1, RemoveError, loader.keyUrl);
 }
 public bool removeLoading(SimpleLoader loader)
 {
     for (int i = 0; i < loadinglist.Count; i++)
     {
         if (loadinglist[i] == loader.keyUrl)
         {
             loadinglist.RemoveAt(i);
             for (int k = 0; k < waitingLoaderlist.Count; k++)
             {
                 SimpleLoader item = waitingLoaderlist[k];
                 if (item.keyUrl == loader.keyUrl)
                 {
                     item.state = loader.state;
                     if (item.needClone == false)
                     {
                         item.loadedData = loader.loadedData;
                     }
                     else
                     {
                         LoadPoolData data;
                         if (pool.TryGetValue(loader.keyUrl, out data))
                         {
                             if (data is PrefabData)
                             {
                                 if (item.canceled == false && item.juseEndReturn == false && item.onloaded != null)
                                 {
                                     item.loadedData = (data as PrefabData).GetNew();
                                 }
                             }
                         }
                         else
                         {
                             Debug.LogError("pool.TryGetValue == false keyUrl =" + loader.keyUrl);
                         }
                     }
                     item.EndOnly();
                     //item.Load();
                     waitingLoaderlist.RemoveAt(k);
                     k--;
                 }
             }
             return(true);
         }
     }
     return(false);
 }