manage_menu_item execute does not run when Unity Editor is inactive
Closed this issue · 4 comments
Description
When executing a menu command (manage_menu_item execute), the action does not run if the Unity Editor is inactive. The command is only executed once the Unity Editor becomes active.
Environment:
Unity version: 6.2 (6000.2.5f1)
unity-mcp version: v3.4.0 main(6e72b33)
OS: Windows & WSL2 (Claude Code)
Notes
It is unclear whether this behavior is due to a Unity Editor setting or is caused by the implementation of unity-mcp.
I suspect that this issue is likely caused by the use of delayCall here.
https://github.com/CoplayDev/unity-mcp/blob/6e72b333092ec099e1712784d2289547cc6db1a1/UnityMcpBridge/Editor/Tools/MenuItems/MenuItemExecutor.cs#L41C17-L41C44
Thanks @toro-ponz. I think removing the delayCall may force the editor to take focus. It might be an annoying UX, but I'll test and confirm if that works. Feel free to test as well if you have to the time to sooner.
@toro-ponz it was the delayCall as you expected. One thing to note, the actions were run for me, but just delayed (true to the function's name lol). As I mentioned it earlier removing it does bring the editor window into focus. It will be included in the next release
This is in the latest release: https://github.com/CoplayDev/unity-mcp/releases/tag/v4.0.0