Exemplo n.º 1
0
 private void AddResource(string url, AssetBundle ab, bool cache)
 {
     if (!assetBundleList.ContainsKey(url))
     {
         assetBundleList.Add(url, new CountableRef(ab, cache));
     }
     else
     {
         assetBundleList[url] = new CountableRef(ab, cache);
     }
 }
Exemplo n.º 2
0
 private void BundleToAsset(string path, IResourceFile file, AssetBundle ab, UnityEngine.Object asset)
 {
     if (file != null && file.singleDirectResource && !file.beDependent && asset != null &&
         (!assetBundleList.ContainsKey(file.targetFile) ||
          !assetBundleList[file.targetFile].cache))
     {
         var cref = new CountableRef(asset);
         cref.RefTarget();
         assetList.Add(file.srcFile, cref);
         ab.Unload(false);
         assetBundleList.Remove(file.targetFile);
     }
     else
     {
         if (assetBundleList.ContainsKey(path) && asset != null)
         {
             assetBundleList[path].RefTarget();
         }
     }
 }