Skip to content

Commit 73230c6

Browse files
Merge pull request #25 from nowsprinting/fix/restart_after_domain_reloading
Fix server auto-restart logic on domain reloading
2 parents 1bd1565 + 1b37698 commit 73230c6

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)