Skip to content

Commit 1b37698

Browse files
committed
Fix server auto-restart logic on domain reloading
1 parent 0c21758 commit 1b37698

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Editor/UnityBridge/McpUnityServer.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,10 @@ static McpUnityServer()
3838
EditorApplication.quitting += Instance.StopServer;
3939

4040
// Auto-restart server after domain reload
41-
EditorApplication.delayCall += () =>
41+
if (McpUnitySettings.Instance.AutoStartServer)
4242
{
43-
if (McpUnitySettings.Instance.AutoStartServer)
44-
{
45-
Instance.StartServer();
46-
}
47-
};
43+
Instance.StartServer();
44+
}
4845
}
4946

5047
/// <summary>

0 commit comments

Comments
 (0)