SuperAPI AI 工具集

uloop-execute-menu-item

编程与开发

查看项目

更新于 10-15 22:12

技能介绍

用途:通过命令行执行 Unity 编辑器的 MenuItem 菜单命令,适合在脚本或自动化流程中触发保存、构建、刷新等编辑器操作。

主要能力:调用指定路径的菜单项;支持反射回退;返回 JSON 格式的执行结果。

使用方式: uloop execute-menu-item --menu-item-path "<path>"

参数:--menu-item-path 为菜单项路径,例如 "GameObject/Create Empty";--use-reflection-fallback 为布尔值,默认 true,表示使用反射回退。

全局选项:--project-path <path>,仅当目标 Unity 项目不是当前目录时需要指定。

示例: uloop execute-menu-item --menu-item-path "GameObject/Create Empty" uloop execute-menu-item --menu-item-path "File/Save" uloop execute-menu-item --menu-item-path "Edit/Project Settings..."

限制:部分菜单项可能依赖特定上下文或选中对象;如不清楚可用菜单路径,可先使用 uloop execute-dynamic-code 进行查询。其余信息暂未提供。