NetworkConnectionHelper에 localhost client 접속 버튼 추가
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user