#if UNITY_2019_4_OR_NEWER 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("资源包调试工具", true, EditorDefine.DockedWindowTypes); wnd.minSize = new Vector2(800, 600); } /// /// 视图模式 /// private enum EViewMode { /// /// 内存视图 /// MemoryView, /// /// 资源对象视图 /// AssetView, /// /// 资源包视图 /// BundleView, } private ToolbarMenu _viewModeMenu; private AssetListDebuggerViewer _assetListViewer; private BundleListDebuggerViewer _bundleListViewer; private EViewMode _viewMode; private readonly DebugReport _debugReport = new DebugReport(); private string _searchKeyWord; public void CreateGUI() { VisualElement root = rootVisualElement; // 加载布局文件 string rootPath = EditorTools.GetYooAssetPath(); string uxml = $"{rootPath}/Editor/AssetBundleDebugger/{nameof(AssetBundleDebuggerWindow)}.uxml"; var visualAsset = AssetDatabase.LoadAssetAtPath(uxml); if (visualAsset == null) { Debug.LogError($"Not found {nameof(AssetBundleDebuggerWindow)}.uxml : {uxml}"); return; } visualAsset.CloneTree(root); // 采样按钮 var sampleBtn = root.Q