Пример #1
0
 private void CollectAssetFromLoader(BaseLoader loader)
 {
     if (loader is AssetBundleLoader)
     {
         if (_dictResourceAssetBundle.ContainsKey(loader.path) == true)
         {
             return;
         }
         AssetBundleLoader assetBundleLoader = loader as AssetBundleLoader;
         if (assetBundleLoader.asset != null)
         {
             _dictResourceAssetBundle.Add(loader.path, new ResourceItem(assetBundleLoader.asset));
         }
         foreach (var sub in assetBundleLoader.assetDependencies)
         {
             if (sub.asset != null)
             {
                 _dictResourceAsset.Add(sub.path, new ResourceItem(sub.asset));
             }
         }
     }
     else if (loader is AssetBundleManifestLoader)
     {
         assetBundleManifest = ((AssetBundleManifestLoader)loader).assetBundleManifest;
     }
     else if (loader is AssetBundleCRCLoader)
     {
         _dictAssetBundleCRC = ((AssetBundleCRCLoader)loader).crcDict;
     }
     else if (loader is TextureLoader)
     {
         if (_dictResourceTexture.ContainsKey(loader.path) == true)
         {
             return;
         }
         ResourceItem r = new ResourceItem(((TextureLoader)loader).texture);
         _dictResourceTexture.Add(loader.path, r);
     }
     else if (loader is AssetLoader)
     {
         if (_dictResourceAsset.ContainsKey(loader.path) == true)
         {
             return;
         }
         ResourceItem r = new ResourceItem(((AssetLoader)loader).asset);
         _dictResourceAsset.Add(loader.path, r);
     }
     else
     {
         Debug.LogErrorFormat("Loader Error {0}", loader.GetType());
     }
 }