static void PrintArchive(TabWriter writer, BuildLayout.Bundle archive)
        {
            AttrBuilder attr = new AttrBuilder();

            attr.AddSize("Size", archive.FileSize);
            attr.Add("Compression", archive.Compression);

            ulong bundleSize = archive.Files.First(x => x.BundleObjectInfo != null).BundleObjectInfo.Size;

            attr.AddSize("Asset Bundle Object Size", bundleSize);

            using (writer.IndentScope($"Archive {archive.Name} {attr}"))
            {
                if (archive.Dependencies != null)
                {
                    writer.WriteLine("Bundle Dependencies: " + string.Join(", ", archive.Dependencies.Select(x => x.Name)));
                }

                if (archive.ExpandedDependencies != null)
                {
                    writer.WriteLine("Expanded Bundle Dependencies: " + string.Join(", ", archive.ExpandedDependencies.Select(x => x.Name)));
                }

                using (writer.IndentScope($"Explicit Assets"))
                {
                    for (int i = 0; i < archive.Files.Count; i++)
                    {
                        BuildLayout.File f = archive.Files[i];
                        foreach (BuildLayout.ExplicitAsset asset in f.Assets)
                        {
                            PrintAsset(writer, asset, i);
                        }
                    }
                }

                using (writer.IndentScope($"Files:"))
                {
                    for (int i = 0; i < archive.Files.Count; i++)
                    {
                        PrintFile(writer, archive.Files[i], i);
                    }
                }
            }
        }
Example #2
0
 public static IEnumerable <BuildLayout.ExplicitAsset> EnumerateAssets(BuildLayout.Bundle bundle)
 {
     return(bundle.Files.SelectMany(f => f.Assets));
 }