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