From f71d545955248bc1d146a311b0dc6941e11a86fe Mon Sep 17 00:00:00 2001 From: xpeng <1216772231@qq.com> Date: Mon, 29 Aug 2022 03:01:49 +0200 Subject: [PATCH] add dbg button config --- Assets/Scripts/Networks/DebugButton.cs | 13 ++++++++----- ProjectSettings/ProjectSettings.asset | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/Networks/DebugButton.cs b/Assets/Scripts/Networks/DebugButton.cs index 15c594e..4bbe8da 100644 --- a/Assets/Scripts/Networks/DebugButton.cs +++ b/Assets/Scripts/Networks/DebugButton.cs @@ -5,11 +5,14 @@ public class DebugButton : MonoBehaviour { private void OnGUI() { GUILayout.BeginArea(new Rect(10, 10, 100, 300)); - //if (!NetworkManager.Singleton.IsClient && !NetworkManager.Singleton.IsServer) { - if (GUILayout.Button("Host")) GetComponent().StartHost(); - if (GUILayout.Button("Client")) GetComponent().StartClient(); - if (GUILayout.Button("Stop")) GetComponent().StopAll(); - //} + if (JsonConfig.HasKey("MultiplayerDebugButton") && JsonConfig.GetBoolean("MultiplayerDebugButton")) + { + if (GUILayout.Button("Host")) GetComponent().StartHost(); + if (GUILayout.Button("Client")) GetComponent().StartClient(); + if (GUILayout.Button("Stop")) GetComponent().StopAll(); + } + else + JsonConfig.SetBoolean("MultiplayerDebugButton", false); GUILayout.EndArea(); } } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index cd876db..d70d6bb 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -218,6 +218,9 @@ PlayerSettings: - {fileID: 0} - {fileID: 0} - {fileID: 0} + - {fileID: 0} + - {fileID: -6018045015233401694, guid: 3999ab811e936714280a476b3a032d86, type: 2} + - {fileID: 6536100391545742739, guid: 55d1ec7a4296de343b6d3bb6f9a19731, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1