using UnityEngine; using Unity.Netcode; public class DebugButton : MonoBehaviour { private void OnGUI() { GUILayout.BeginArea(new Rect(10, 10, 100, 300)); if (JsonConfig.HasKey("MultiplayerDebugButton")) { if (!JsonConfig.GetBoolean("MultiplayerDebugButton")) return; 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(); } }