Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 internal LoadedAssetBundle(BundleMetadata metadata, AssetBundle assetBundle)
 {
     Metadata        = Argument.NotNull(metadata);
     AssetBundle     = Argument.NotNull(assetBundle);
     ReferencedCount = 1;
 }
Exemplo n.º 3
0
 public bool TryGetValue(string name, out BundleMetadata bundle)
 {
     return(_validIdentifiers.TryGetValue(name, out bundle));
 }