Skip to content

Commit 10903a2

Browse files
committed
fix(setup): reuse stored project port in StartAutoConnect to avoid port changes during client setup
1 parent f4bc7cd commit 10903a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

UnityMcpBridge/Editor/UnityMcpBridge.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public static void StartAutoConnect()
4545

4646
try
4747
{
48-
// Discover new port and save it
49-
currentUnityPort = PortManager.DiscoverNewPort();
48+
// Reuse stored project port when available to avoid port changes during setup
49+
currentUnityPort = PortManager.GetPortWithFallback();
5050

5151
listener = new TcpListener(IPAddress.Loopback, currentUnityPort);
5252
listener.Start();

0 commit comments

Comments
 (0)