Exemplo n.º 1
0
    public void OnEnable()
    {
        //Construct more readily editable asset mapping
        assets = new List <ListingEditorEntry>();
        var assetsByName           = new Dictionary <string, ListingEditorEntry>();
        AssetBundleListing listing = target as AssetBundleListing;

        foreach (var pair in listing.assets)
        {
            AssetBundleContents contents = pair.Load();
            if (contents != null)
            {
                foreach (var entry in contents.assets)
                {
                    if (!assetsByName.ContainsKey(entry.name))
                    {
                        var newEntry = new ListingEditorEntry();
                        newEntry.name            = entry.name;
                        assetsByName[entry.name] = newEntry;
                        assets.Add(newEntry);
                    }
                    assetsByName[entry.name].assets[contents.platform] = entry.isInherited ? null : entry.asset;
                }
            }
        }
    }
    public void OnEnable()
    {
        //Construct more readily editable asset mapping
        assets = new List<ListingEditorEntry>();
        var assetsByName = new Dictionary<string, ListingEditorEntry>();
        AssetBundleListing listing = target as AssetBundleListing;

        foreach(var pair in listing.assets){
            AssetBundleContents contents = pair.Load();
            if(contents != null){
                foreach(var entry in contents.assets){
                    if(!assetsByName.ContainsKey(entry.name)){
                        var newEntry = new ListingEditorEntry();
                        newEntry.name = entry.name;
                        assetsByName[entry.name] = newEntry;
                        assets.Add(newEntry);
                    }
                    assetsByName[entry.name].assets[contents.platform] = entry.isInherited ? null : entry.asset;
                }
            }
        }
    }