mirror of
https://github.com/xiaopeng12138/MaiDXR.git
synced 2024-12-18 03:45:55 +01:00
20 lines
704 B
C#
20 lines
704 B
C#
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<StartManager>().StartHost();
|
|
if (GUILayout.Button("Client")) GetComponent<StartManager>().StartClient();
|
|
if (GUILayout.Button("Stop")) GetComponent<StartManager>().StopAll();
|
|
}
|
|
else
|
|
JsonConfig.SetBoolean("MultiplayerDebugButton", false);
|
|
GUILayout.EndArea();
|
|
}
|
|
}
|