Exemple #1
0
 public void FlattenResource(Resource mainResource, List <Resource> queue)
 {
     queue.Add(mainResource);
     mainResource.AddEventListener <Resource>(Resource.DOWNLOAD_BEGIN, OnDownloadbegin);
     mainResource.AddEventListener <Resource>(Resource.DOWNLOAD_END, OnDownloadEnd);
     mainResource.AddEventListener <Resource>(Resource.DOWNLOAD_ERROR, OnDownloadError);
     mainResource.dependencies = ResourceManager.Instance.GetDependencies(mainResource.BundlePath);
     if (mainResource.dependencies != null)
     {
         for (int i = 0; i < mainResource.dependencies.Count; i++)
         {
             Resource resource = mainResource.dependencies[i];
             if (resource.hasWwwDone)
             {
                 resource.Reference();
                 continue;
             }
             FlattenResource(resource, queue);
         }
     }
 }