From da8c87d0826f1db80ffe63c6c4fc5a1f21fb3469 Mon Sep 17 00:00:00 2001 From: dal4segno Date: Tue, 17 Feb 2026 15:25:25 +0900 Subject: [PATCH] =?UTF-8?q?NetworkConnectionHelper=EC=97=90=20localhost=20?= =?UTF-8?q?client=20=EC=A0=91=EC=86=8D=20=EB=B2=84=ED=8A=BC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Editor/NetworkConnectionHelperEditor.cs | 5 +++++ Assets/Scripts/NetworkConnectionHelper.cs | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Assets/Scripts/Editor/NetworkConnectionHelperEditor.cs b/Assets/Scripts/Editor/NetworkConnectionHelperEditor.cs index 494aa8d..ca91eaf 100644 --- a/Assets/Scripts/Editor/NetworkConnectionHelperEditor.cs +++ b/Assets/Scripts/Editor/NetworkConnectionHelperEditor.cs @@ -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()); diff --git a/Assets/Scripts/NetworkConnectionHelper.cs b/Assets/Scripts/NetworkConnectionHelper.cs index 10e1423..856dc7d 100644 --- a/Assets/Scripts/NetworkConnectionHelper.cs +++ b/Assets/Scripts/NetworkConnectionHelper.cs @@ -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)