NetworkConnectionHelper에 localhost client 접속 버튼 추가

This commit is contained in:
2026-02-17 15:25:25 +09:00
parent 63a742d5d4
commit da8c87d082
2 changed files with 22 additions and 0 deletions

View File

@@ -54,6 +54,11 @@ namespace Northbound.Editor
_helper.StartClient();
}
if (GUILayout.Button("Start Localhost Client", GUILayout.Height(30)))
{
_helper.StartLocalhostClient();
}
EditorGUI.EndDisabledGroup();
EditorGUI.BeginDisabledGroup(!IsConnected());

View File

@@ -62,6 +62,23 @@ namespace Northbound
}
}
public void StartLocalhostClient()
{
if (NetworkManager.Singleton == null)
{
Debug.LogError("[NetworkConnectionHelper] NetworkManager not found!");
return;
}
ConfigureTransport("127.0.0.1", port);
if (!NetworkManager.Singleton.IsClient && !NetworkManager.Singleton.IsServer)
{
NetworkManager.Singleton.StartClient();
Debug.Log($"[NetworkConnectionHelper] Connecting to localhost:{port}");
}
}
public void StartServer()
{
if (NetworkManager.Singleton == null)