From 8deb23945023c40a4966844da75d9427d6fc8ff1 Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 15 Jun 2022 16:52:54 +0800 Subject: [PATCH] Update remote debugger Support remote mobie device debugging --- .../AssetBundleDebuggerWindow.cs | 308 +++++++++++------- .../RemotePlayerSession.cs | 51 +++ .../RemotePlayerSession.cs.meta | 11 + .../VisualViewers/DebuggerAssetListViewer.cs | 2 +- .../VisualViewers/DebuggerBundleListViewer.cs | 2 +- .../Runtime/AssetSystem/AssetSystem.cs | 10 +- .../Loader/AssetBundleFileLoader.cs | 2 +- .../Loader/AssetBundleWebLoader.cs | 7 +- .../Loader/DependAssetBundleGrouper.cs | 2 +- .../AssetSystem/Provider/BundledProvider.cs | 2 +- .../Runtime/Debugger/DebugBundleInfo.cs | 8 +- .../Runtime/Debugger/DebugProviderInfo.cs | 13 +- .../YooAsset/Runtime/Debugger/DebugReport.cs | 44 ++- .../Runtime/Debugger/RemoteCommand.cs | 45 +++ .../Runtime/Debugger/RemoteCommand.cs.meta | 11 + .../Runtime/Debugger/RemoteDebuggerDefine.cs | 12 + .../Debugger/RemoteDebuggerDefine.cs.meta | 11 + .../Debugger/RemoteDebuggerInRuntime.cs | 64 ++++ .../Debugger/RemoteDebuggerInRuntime.cs.meta | 11 + Assets/YooAsset/Runtime/YooAssets.cs | 16 +- 20 files changed, 475 insertions(+), 157 deletions(-) create mode 100644 Assets/YooAsset/Editor/AssetBundleDebugger/RemotePlayerSession.cs create mode 100644 Assets/YooAsset/Editor/AssetBundleDebugger/RemotePlayerSession.cs.meta create mode 100644 Assets/YooAsset/Runtime/Debugger/RemoteCommand.cs create mode 100644 Assets/YooAsset/Runtime/Debugger/RemoteCommand.cs.meta create mode 100644 Assets/YooAsset/Runtime/Debugger/RemoteDebuggerDefine.cs create mode 100644 Assets/YooAsset/Runtime/Debugger/RemoteDebuggerDefine.cs.meta create mode 100644 Assets/YooAsset/Runtime/Debugger/RemoteDebuggerInRuntime.cs create mode 100644 Assets/YooAsset/Runtime/Debugger/RemoteDebuggerInRuntime.cs.meta diff --git a/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs b/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs index 3886641..b1e9d05 100644 --- a/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs @@ -1,144 +1,216 @@ #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 ShowExample() - { - AssetBundleDebuggerWindow wnd = GetWindow("资源包调试工具", true, EditorDefine.DockedWindowTypes); - wnd.minSize = new Vector2(800, 600); - } + 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, + /// + /// 视图模式 + /// + private enum EViewMode + { + /// + /// 内存视图 + /// + MemoryView, - /// - /// 资源对象视图 - /// - AssetView, + /// + /// 资源对象视图 + /// + AssetView, - /// - /// 资源包视图 - /// - BundleView, - } - - private ToolbarMenu _viewModeMenu; - private DebuggerAssetListViewer _assetListViewer; - private DebuggerBundleListViewer _bundleListViewer; - - private EViewMode _viewMode; - private readonly DebugReport _debugReport = new DebugReport(); - private string _searchKeyWord; + /// + /// 资源包视图 + /// + BundleView, + } - public void CreateGUI() - { + private readonly Dictionary _playerSessions = new Dictionary(); + + private ToolbarMenu _viewModeMenu; + private DebuggerAssetListViewer _assetListViewer; + private DebuggerBundleListViewer _bundleListViewer; + + private EViewMode _viewMode; + private DebugReport _debugReport; + private string _searchKeyWord; + + + public void CreateGUI() + { try { - VisualElement root = rootVisualElement; + VisualElement root = rootVisualElement; - // 加载布局文件 - var visualAsset = EditorHelper.LoadWindowUXML(); - if (visualAsset == null) - return; - - visualAsset.CloneTree(root); + // 加载布局文件 + var visualAsset = EditorHelper.LoadWindowUXML(); + if (visualAsset == null) + return; - // 采样按钮 - var sampleBtn = root.Q