示例#1
0
        protected override string ProcessGroup(AddressableAssetGroup assetGroup, AddressableAssetsBuildContext context)
        {
            foreach (var entry in assetGroup.entries)
            {
                SpriteAtlasBuildUtils.ProcessEntry(entry, context);
            }

            return(base.ProcessGroup(assetGroup, context));
        }
示例#2
0
        protected override string ProcessGroup(AddressableAssetGroup assetGroup, AddressableAssetsBuildContext aaContext)
        {
            foreach (var entry in assetGroup.entries)
            {
                if (entry == null || string.IsNullOrEmpty(entry.AssetPath))
                {
                    continue;
                }

                // If the entry is a folder, process each of the assets in the folder. Otherwise,
                // process the entry as a single asset.
                if (entry.AssetPath == ResourcesPath ||
                    entry.AssetPath == EditorSceneListPath ||
                    File.GetAttributes(entry.AssetPath).HasFlag(FileAttributes.Directory))
                {
                    var allEntries = new List <AddressableAssetEntry>();
                    entry.GatherAllAssets(allEntries, false, true, false);
                    foreach (var folderEntry in allEntries)
                    {
                        // Create default catalog entries.
                        folderEntry.CreateCatalogEntries(
                            aaContext.locations,
                            false,
                            typeof(AssetDatabaseProvider).FullName,
                            null,
                            null,
                            aaContext.providerTypes);

                        // Create additional catalog entries if the asset is a `SpriteAtlas`.
                        SpriteAtlasBuildUtils.ProcessEntry(folderEntry, aaContext);
                    }
                }
                else
                {
                    // Create default catalog entries.
                    entry.CreateCatalogEntries(
                        aaContext.locations,
                        false,
                        typeof(AssetDatabaseProvider).FullName,
                        null,
                        null,
                        aaContext.providerTypes);

                    // Create additional catalog entries if the asset is a `SpriteAtlas`.
                    SpriteAtlasBuildUtils.ProcessEntry(entry, aaContext);
                }
            }

            return(string.Empty);
        }