#if UNITY_2019_4_OR_NEWER using System; using System.Collections.Generic; using UnityEditor; using UnityEngine; using UnityEngine.UIElements; using UnityEditor.UIElements; using UnityEditor.Networking.PlayerConnection; using UnityEngine.Networking.PlayerConnection; namespace YooAsset.Editor { public class AssetBundleDebuggerWindow : EditorWindow { [MenuItem("YooAsset/AssetBundle Debugger", false, 104)] public static void OpenWindow() { AssetBundleDebuggerWindow wnd = GetWindow("AssetBundle Debugger", true, WindowsDefine.DockedWindowTypes); wnd.minSize = new Vector2(800, 600); } /// /// 视图模式 /// private enum EViewMode { /// /// 内存视图 /// MemoryView, /// /// 资源对象视图 /// AssetView, /// /// 资源包视图 /// BundleView, } private readonly Dictionary _playerSessions = new Dictionary(); private Label _playerName; private ToolbarMenu _viewModeMenu; private SliderInt _frameSlider; private DebuggerAssetListViewer _assetListViewer; private DebuggerBundleListViewer _bundleListViewer; private EViewMode _viewMode; private string _searchKeyWord; private DebugReport _currentReport; private RemotePlayerSession _currentPlayerSession; private int _rangeIndex = 0; public void CreateGUI() { try { VisualElement root = rootVisualElement; // 加载布局文件 var visualAsset = UxmlLoader.LoadWindowUXML(); if (visualAsset == null) return; visualAsset.CloneTree(root); // 采样按钮 var sampleBtn = root.Q