BundleMetadata CreateMetadata(string bundle)
        {
            var            hash = Manifest.GetAssetBundleHash(bundle);
            var            name = bundle.Replace("_" + hash, "");
            BundleMetadata metadata;

            if (_validIdentifiers.TryGetValue(name, out metadata))
            {
                return(metadata);
            }
            var paths = new List <string>();

            AddUnique(paths, bundle);
            AddUnique(paths, name);
            AddUnique(paths, hash.ToString());
            var dependencies = new List <BundleMetadata>();

            foreach (var dep in Manifest.GetAllDependencies(bundle))
            {
                dependencies.Add(CreateMetadata(dep));
            }
            metadata = new BundleMetadata(name, hash, dependencies, paths);
            _validIdentifiers[name] = metadata;
            return(metadata);
        }
 public bool TryGetValue(string name, out BundleMetadata bundle)
 {
     return(_validIdentifiers.TryGetValue(name, out bundle));
 }
Beispiel #3
0
 public LoadedAssetBundle(BundleMetadata metadata, AssetBundle assetBundle)
 {
     Metadata        = Argument.NotNull(metadata);
     AssetBundle     = Argument.NotNull(assetBundle);
     ReferencedCount = 1;
 }