From 8eb7816e306a466bcdfd17c534c77160cade5f93 Mon Sep 17 00:00:00 2001 From: hevinci Date: Sat, 22 Oct 2022 15:39:26 +0800 Subject: [PATCH] Update AssetBundleDebugger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 界面增加了包裹名称显示列。 --- .../VisualViewers/DebuggerAssetListViewer.cs | 45 ++++++++--- .../DebuggerAssetListViewer.uxml | 1 + .../VisualViewers/DebuggerBundleListViewer.cs | 78 +++++++++++++------ .../DebuggerBundleListViewer.uxml | 1 + 4 files changed, 91 insertions(+), 34 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerAssetListViewer.cs b/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerAssetListViewer.cs index 5bdf1d3..fedaa46 100644 --- a/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerAssetListViewer.cs +++ b/Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/DebuggerAssetListViewer.cs @@ -27,7 +27,7 @@ namespace YooAsset.Editor _visualAsset = EditorHelper.LoadWindowUXML(); if (_visualAsset == null) return; - + _root = _visualAsset.CloneTree(); _root.style.flexGrow = 1f; @@ -72,15 +72,24 @@ namespace YooAsset.Editor } private List FilterViewItems(DebugReport debugReport, string searchKeyWord) { - var result = new List(debugReport.ProviderInfos.Count); - foreach (var providerInfo in debugReport.ProviderInfos) + List result = new List(1000); + foreach (var packageData in debugReport.PackageDatas) { - if (string.IsNullOrEmpty(searchKeyWord) == false) + var tempList = new List(packageData.ProviderInfos.Count); + foreach (var providerInfo in packageData.ProviderInfos) { - if (providerInfo.AssetPath.Contains(searchKeyWord) == false) - continue; + if (string.IsNullOrEmpty(searchKeyWord) == false) + { + if (providerInfo.AssetPath.Contains(searchKeyWord) == false) + continue; + } + + providerInfo.PackageName = packageData.PackageName; + tempList.Add(providerInfo); } - result.Add(providerInfo); + + tempList.Sort(); + result.AddRange(tempList); } return result; } @@ -102,12 +111,22 @@ namespace YooAsset.Editor } - // 资源列表相关 + // 顶部列表相关 private VisualElement MakeAssetListViewItem() { VisualElement element = new VisualElement(); element.style.flexDirection = FlexDirection.Row; + { + var label = new Label(); + label.name = "Label0"; + label.style.unityTextAlign = TextAnchor.MiddleLeft; + label.style.marginLeft = 3f; + //label.style.flexGrow = 1f; + label.style.width = 150; + element.Add(label); + } + { var label = new Label(); label.name = "Label1"; @@ -165,6 +184,10 @@ namespace YooAsset.Editor var sourceData = _assetListView.itemsSource as List; var providerInfo = sourceData[index]; + // Package Name + var label0 = element.Q