From 46467171bab82f3d321beed4f75f39bc93e2efed Mon Sep 17 00:00:00 2001 From: hevinci Date: Sat, 9 Apr 2022 14:30:46 +0800 Subject: [PATCH] Update AssetBundleDebugger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了AssetBundleDebugger窗口的BundleView视口下,Bundle列表内元素重复的问题。 修复了AssetBundleDebugger窗口的BundleView视口下,Using列表显示不完整的问题。 --- .../VisualViewers/BundleListDebuggerViewer.cs | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/BundleListDebuggerViewer.cs b/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/BundleListDebuggerViewer.cs index a1af8ac..26aed74 100644 --- a/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/BundleListDebuggerViewer.cs +++ b/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/BundleListDebuggerViewer.cs @@ -15,7 +15,7 @@ namespace YooAsset.Editor private TemplateContainer _root; private ListView _bundleListView; - private ListView _includeListView; + private ListView _usingListView; private DebugReport _debugReport; /// @@ -35,7 +35,7 @@ namespace YooAsset.Editor _root = _visualAsset.CloneTree(); _root.style.flexGrow = 1f; - // 资源列表 + // 资源包列表 _bundleListView = _root.Q("TopListView"); _bundleListView.makeItem = MakeAssetListViewItem; _bundleListView.bindItem = BindAssetListViewItem; @@ -45,10 +45,10 @@ namespace YooAsset.Editor #else _bundleListView.onSelectionChanged += BundleListView_onSelectionChange; #endif - // 依赖列表 - _includeListView = _root.Q("BottomListView"); - _includeListView.makeItem = MakeIncludeListViewItem; - _includeListView.bindItem = BindIncludeListViewItem; + // 使用列表 + _usingListView = _root.Q("BottomListView"); + _usingListView.makeItem = MakeIncludeListViewItem; + _usingListView.bindItem = BindIncludeListViewItem; } /// @@ -62,7 +62,7 @@ namespace YooAsset.Editor } private List FilterViewItems(DebugReport debugReport, string searchKeyWord) { - var result = new List(debugReport.ProviderInfos.Count); + Dictionary result = new Dictionary(debugReport.ProviderInfos.Count); foreach (var providerInfo in debugReport.ProviderInfos) { foreach(var bundleInfo in providerInfo.BundleInfos) @@ -72,10 +72,11 @@ namespace YooAsset.Editor if (bundleInfo.BundleName.Contains(searchKeyWord) == false) continue; } - result.Add(bundleInfo); + if(result.ContainsKey(bundleInfo.BundleName) == false) + result.Add(bundleInfo.BundleName, bundleInfo); } } - return result; + return result.Values.ToList(); } /// @@ -175,7 +176,7 @@ namespace YooAsset.Editor foreach (var item in objs) { DebugBundleInfo bundleInfo = item as DebugBundleInfo; - FillIncludeListView(bundleInfo); + FillUsingListView(bundleInfo.BundleName); } } @@ -219,7 +220,7 @@ namespace YooAsset.Editor } private void BindIncludeListViewItem(VisualElement element, int index) { - List providers = _includeListView.itemsSource as List; + List providers = _usingListView.itemsSource as List; DebugProviderInfo providerInfo = providers[index]; // Asset Path @@ -234,18 +235,24 @@ namespace YooAsset.Editor var label3 = element.Q