2022-08-29 02:53:00 +02:00
|
|
|
using UnityEngine;
|
|
|
|
using Unity.Netcode;
|
|
|
|
|
|
|
|
public class DebugButton : MonoBehaviour
|
|
|
|
{
|
|
|
|
private void OnGUI() {
|
|
|
|
GUILayout.BeginArea(new Rect(10, 10, 100, 300));
|
2022-08-29 03:01:49 +02:00
|
|
|
if (JsonConfig.HasKey("MultiplayerDebugButton") && JsonConfig.GetBoolean("MultiplayerDebugButton"))
|
|
|
|
{
|
|
|
|
if (GUILayout.Button("Host")) GetComponent<StartManager>().StartHost();
|
|
|
|
if (GUILayout.Button("Client")) GetComponent<StartManager>().StartClient();
|
|
|
|
if (GUILayout.Button("Stop")) GetComponent<StartManager>().StopAll();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
JsonConfig.SetBoolean("MultiplayerDebugButton", false);
|
2022-08-29 02:53:00 +02:00
|
|
|
GUILayout.EndArea();
|
|
|
|
}
|
|
|
|
}
|