From 857eb1d0bb32bdaee7e7d22a88b1cb5a9d707cbf Mon Sep 17 00:00:00 2001 From: hevinci Date: Tue, 15 Mar 2022 22:30:57 +0800 Subject: [PATCH] Update AssetBundleDebugger --- ...Profiler.meta => AssetBundleDebugger.meta} | 0 .../AssetBundleDebugger.uxml | 7 + .../AssetBundleDebugger.uxml.meta | 10 + .../AssetBundleDebuggerWindow.cs | 63 +++++ .../AssetBundleDebuggerWindow.cs.meta} | 0 .../AssetBundleDebugger/VisualViewers.meta | 8 + .../VisualViewers/AssetListDebuggerViewer.cs | 237 ++++++++++++++++++ .../AssetListDebuggerViewer.cs.meta | 11 + .../AssetListDebuggerViewer.uxml | 19 ++ .../AssetListDebuggerViewer.uxml.meta | 10 + .../AssetBundleProfilerWindow.cs | 11 - 11 files changed, 365 insertions(+), 11 deletions(-) rename Assets/YooAsset/Editor/{AssetBundleProfiler.meta => AssetBundleDebugger.meta} (100%) create mode 100644 Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebugger.uxml create mode 100644 Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebugger.uxml.meta create mode 100644 Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs rename Assets/YooAsset/Editor/{AssetBundleProfiler/AssetBundleProfilerWindow.cs.meta => AssetBundleDebugger/AssetBundleDebuggerWindow.cs.meta} (100%) create mode 100644 Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers.meta create mode 100644 Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/AssetListDebuggerViewer.cs create mode 100644 Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/AssetListDebuggerViewer.cs.meta create mode 100644 Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/AssetListDebuggerViewer.uxml create mode 100644 Assets/YooAsset/Editor/AssetBundleDebugger/VisualViewers/AssetListDebuggerViewer.uxml.meta delete mode 100644 Assets/YooAsset/Editor/AssetBundleProfiler/AssetBundleProfilerWindow.cs diff --git a/Assets/YooAsset/Editor/AssetBundleProfiler.meta b/Assets/YooAsset/Editor/AssetBundleDebugger.meta similarity index 100% rename from Assets/YooAsset/Editor/AssetBundleProfiler.meta rename to Assets/YooAsset/Editor/AssetBundleDebugger.meta diff --git a/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebugger.uxml b/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebugger.uxml new file mode 100644 index 0000000..b0f3d16 --- /dev/null +++ b/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebugger.uxml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebugger.uxml.meta b/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebugger.uxml.meta new file mode 100644 index 0000000..599022d --- /dev/null +++ b/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebugger.uxml.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 790db12999afd334e8fb6ba70ef0a947 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs b/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs new file mode 100644 index 0000000..b273163 --- /dev/null +++ b/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs @@ -0,0 +1,63 @@ +using UnityEditor; +using UnityEngine; +using UnityEngine.UIElements; +using UnityEditor.UIElements; + +namespace YooAsset.Editor +{ + public class AssetBundleDebuggerWindow : EditorWindow + { + [MenuItem("YooAsset/AssetBundle Debugger", false, 104)] + public static void ShowExample() + { + AssetBundleDebuggerWindow wnd = GetWindow(); + wnd.titleContent = new GUIContent("资源包调试工具"); + wnd.minSize = new Vector2(800, 600); + } + + private AssetListDebuggerViewer _assetListViewer; + private readonly DebugSummy _summy = new DebugSummy(); + private string _searchKeyWord; + + + public void CreateGUI() + { + VisualElement root = rootVisualElement; + + // 加载布局文件 + string uxml = "Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebugger.uxml"; + var visualAsset = AssetDatabase.LoadAssetAtPath(uxml); + if (visualAsset == null) + { + Debug.LogError($"Not found AssetBundleDebugger.uxml : {uxml}"); + return; + } + visualAsset.CloneTree(root); + + // 采样按钮 + var sampleBtn = root.Q