fix(bridge): prefer persisted project port at start to avoid initial 6400 blip after UPM import

main
David Sarno 2025-08-08 08:18:33 -07:00
parent 5c632f0ab3
commit 57592017ae
1 changed files with 3 additions and 4 deletions

View File

@ -141,12 +141,11 @@ namespace UnityMcpBridge.Editor
Stop(); Stop();
// Attempt fast bind with same-port preference // Attempt fast bind with stored-port preference (sticky per-project)
try try
{ {
currentUnityPort = currentUnityPort > 0 && PortManager.IsPortAvailable(currentUnityPort) // Always consult PortManager first so we prefer the persisted project port
? currentUnityPort currentUnityPort = PortManager.GetPortWithFallback();
: PortManager.GetPortWithFallback();
const int maxImmediateRetries = 3; const int maxImmediateRetries = 3;
const int retrySleepMs = 75; const int retrySleepMs = 75;