From aea9099e34884e37d095e9705d6ccd57c8b5e0ad Mon Sep 17 00:00:00 2001 From: hevinci Date: Mon, 18 Jul 2022 16:26:47 +0800 Subject: [PATCH] Update AssetBundleReporter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加主资源总数的统计。 --- .../Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs | 1 + .../Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs | 5 +++++ .../VisualViewers/ReporterSummaryViewer.cs | 1 + 3 files changed, 7 insertions(+) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs index ef31b28..4018e2d 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs @@ -90,6 +90,7 @@ namespace YooAsset.Editor // 构建结果 public int AssetFileTotalCount; + public int MainAssetTotalCount; public int AllBundleTotalCount; public long AllBundleTotalSize; public int BuildinBundleTotalCount; diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs index c66fb86..f327884 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs @@ -61,6 +61,7 @@ namespace YooAsset.Editor // 构建结果 buildReport.Summary.AssetFileTotalCount = buildMapContext.AssetFileCount; + buildReport.Summary.MainAssetTotalCount = GetMainAssetCount(patchManifest); buildReport.Summary.AllBundleTotalCount = GetAllBundleCount(patchManifest); buildReport.Summary.AllBundleTotalSize = GetAllBundleSize(patchManifest); buildReport.Summary.BuildinBundleTotalCount = GetBuildinBundleCount(patchManifest); @@ -159,6 +160,10 @@ namespace YooAsset.Editor return result; } + private int GetMainAssetCount(PatchManifest patchManifest) + { + return patchManifest.AssetList.Count; + } private int GetAllBundleCount(PatchManifest patchManifest) { return patchManifest.BundleList.Count; diff --git a/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterSummaryViewer.cs b/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterSummaryViewer.cs index ad8506c..6915e3f 100644 --- a/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterSummaryViewer.cs +++ b/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterSummaryViewer.cs @@ -85,6 +85,7 @@ namespace YooAsset.Editor _items.Add(new ItemWrapper(string.Empty, string.Empty)); _items.Add(new ItemWrapper("构建结果", string.Empty)); _items.Add(new ItemWrapper("构建文件总数", $"{buildReport.Summary.AssetFileTotalCount}")); + _items.Add(new ItemWrapper("主资源总数", $"{buildReport.Summary.MainAssetTotalCount}")); _items.Add(new ItemWrapper("资源包总数", $"{buildReport.Summary.AllBundleTotalCount}")); _items.Add(new ItemWrapper("资源包总大小", ConvertSize(buildReport.Summary.AllBundleTotalSize))); _items.Add(new ItemWrapper("内置资源包总数", $"{buildReport.Summary.BuildinBundleTotalCount}"));