Skip to content

Commit bbe1fb6

Browse files
committed
docs: update README with expanded tools and resources documentation
- Added new tools: manage_prefabs, create_script, delete_script, get_sha - Added new resources: editor state, windows, project info, layers, and tags - Clarified manage_script as compatibility router with recommendation to use newer edit tools - Fixed run_test to run_tests for consistency
1 parent d78ea82 commit bbe1fb6

File tree

2 files changed

+64
-28
lines changed

2 files changed

+64
-28
lines changed

README-zh.md

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,42 @@ MCP for Unity 作为桥梁,允许 AI 助手(如 Claude、Cursor)通过本
3838

3939
您的大语言模型可以使用以下功能:
4040

41-
* `execute_menu_item`: 执行 Unity 编辑器菜单项(例如,"File/Save Project")。
42-
* `manage_asset`: 执行资源操作(导入、创建、修改、删除等)。
43-
* `manage_editor`: 控制和查询编辑器的状态和设置。
44-
* `manage_gameobject`: 管理游戏对象:创建、修改、删除、查找和组件操作。
45-
* `manage_scene`: 管理场景(加载、保存、创建、获取层次结构等)。
46-
* `manage_script`: 管理 C# 脚本(创建、读取、更新、删除)。
47-
* `manage_shader`: 执行着色器 CRUD 操作(创建、读取、修改、删除)。
48-
* `read_console`: 获取控制台消息或清除控制台。
49-
* `run_test`: 在 Unity 编辑器中运行测试。
50-
* `apply_text_edits`: 具有前置条件哈希和原子多编辑批次的精确文本编辑。
51-
* `script_apply_edits`: 结构化 C# 方法/类编辑(插入/替换/删除),具有更安全的边界。
52-
* `validate_script`: 快速验证(基本/标准)以在写入前后捕获语法/结构问题。
41+
* `execute_menu_item`: 执行 Unity 编辑器菜单项(例如,"File/Save Project")。
42+
* `manage_asset`: 执行资源操作(导入、创建、修改、删除等)。
43+
* `manage_editor`: 控制和查询编辑器的状态和设置。
44+
* `manage_gameobject`: 管理游戏对象:创建、修改、删除、查找和组件操作。
45+
* `manage_prefabs`: 执行预制件操作(创建、修改、删除等)。
46+
* `manage_scene`: 管理场景(加载、保存、创建、获取层次结构等)。
47+
* `manage_script`: 传统脚本操作的兼容性路由器(创建、读取、删除)。建议使用 `apply_text_edits``script_apply_edits` 进行编辑。
48+
* `manage_shader`: 执行着色器 CRUD 操作(创建、读取、修改、删除)。
49+
* `read_console`: 获取控制台消息或清除控制台。
50+
* `run_tests`: 在 Unity 编辑器中运行测试。
51+
* `set_active_instance`: 将后续工具调用路由到特定的 Unity 实例(当运行多个实例时)。
52+
* `apply_text_edits`: 具有前置条件哈希和原子多编辑批次的精确文本编辑。
53+
* `script_apply_edits`: 结构化 C# 方法/类编辑(插入/替换/删除),具有更安全的边界。
54+
* `validate_script`: 快速验证(基本/标准)以在写入前后捕获语法/结构问题。
55+
* `create_script`: 在给定的项目路径创建新的 C# 脚本。
56+
* `delete_script`: 通过 URI 或 Assets 相对路径删除 C# 脚本。
57+
* `get_sha`: 获取 Unity C# 脚本的 SHA256 和基本元数据,而不返回文件内容。
58+
</details>
59+
60+
61+
<details open>
62+
<summary><strong> 可用资源 </strong></summary>
63+
64+
您的大语言模型可以检索以下资源:
65+
66+
* `unity_instances`: 列出所有正在运行的 Unity 编辑器实例及其详细信息(名称、路径、端口、状态)。
67+
* `menu_items`: 检索 Unity 编辑器中所有可用的菜单项。
68+
* `tests`: 检索 Unity 编辑器中所有可用的测试。可以选择特定类型的测试(例如,"EditMode"、"PlayMode")。
69+
* `editor_active_tool`: 当前活动的编辑器工具(移动、旋转、缩放等)和变换手柄设置。
70+
* `editor_prefab_stage`: 如果预制件在隔离模式下打开,则为当前预制件编辑上下文。
71+
* `editor_selection`: 有关编辑器中当前选定对象的详细信息。
72+
* `editor_state`: 当前编辑器运行时状态,包括播放模式、编译状态、活动场景和选择摘要。
73+
* `editor_windows`: 所有当前打开的编辑器窗口及其标题、类型、位置和焦点状态。
74+
* `project_info`: 静态项目信息,包括根路径、Unity 版本和平台。
75+
* `project_layers`: 项目 TagManager 中定义的所有层及其索引(0-31)。
76+
* `project_tags`: 项目 TagManager 中定义的所有标签。
5377
</details>
5478

5579
---

README.md

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,23 @@ MCP for Unity acts as a bridge, allowing AI assistants (like Claude, Cursor) to
4040

4141
Your LLM can use functions like:
4242

43-
* `execute_menu_item`: Executes Unity Editor menu items (e.g., "File/Save Project").
44-
* `manage_asset`: Performs asset operations (import, create, modify, delete, etc.).
45-
* `manage_editor`: Controls and queries the editor's state and settings.
46-
* `manage_gameobject`: Manages GameObjects: create, modify, delete, find, and component operations.
47-
* `manage_scene`: Manages scenes (load, save, create, get hierarchy, etc.).
48-
* `manage_script`: Manages C# scripts (create, read, update, delete).
49-
* `manage_shader`: Performs shader CRUD operations (create, read, modify, delete).
50-
* `read_console`: Gets messages from or clears the console.
51-
* `run_test`: Runs a tests in the Unity Editor.
52-
* `set_active_instance`: Routes subsequent tool calls to a specific Unity instance (when multiple are running).
53-
* `apply_text_edits`: Precise text edits with precondition hashes and atomic multi-edit batches.
54-
* `script_apply_edits`: Structured C# method/class edits (insert/replace/delete) with safer boundaries.
55-
* `validate_script`: Fast validation (basic/standard) to catch syntax/structure issues before/after writes.
43+
* `execute_menu_item`: Executes Unity Editor menu items (e.g., "File/Save Project").
44+
* `manage_asset`: Performs asset operations (import, create, modify, delete, etc.).
45+
* `manage_editor`: Controls and queries the editor's state and settings.
46+
* `manage_gameobject`: Manages GameObjects: create, modify, delete, find, and component operations.
47+
* `manage_prefabs`: Performs prefab operations (create, modify, delete, etc.).
48+
* `manage_scene`: Manages scenes (load, save, create, get hierarchy, etc.).
49+
* `manage_script`: Compatibility router for legacy script operations (create, read, delete). Prefer `apply_text_edits` or `script_apply_edits` for edits.
50+
* `manage_shader`: Performs shader CRUD operations (create, read, modify, delete).
51+
* `read_console`: Gets messages from or clears the console.
52+
* `run_tests`: Runs tests in the Unity Editor.
53+
* `set_active_instance`: Routes subsequent tool calls to a specific Unity instance (when multiple are running).
54+
* `apply_text_edits`: Precise text edits with precondition hashes and atomic multi-edit batches.
55+
* `script_apply_edits`: Structured C# method/class edits (insert/replace/delete) with safer boundaries.
56+
* `validate_script`: Fast validation (basic/standard) to catch syntax/structure issues before/after writes.
57+
* `create_script`: Create a new C# script at the given project path.
58+
* `delete_script`: Delete a C# script by URI or Assets-relative path.
59+
* `get_sha`: Get SHA256 and basic metadata for a Unity C# script without returning file contents.
5660
</details>
5761

5862

@@ -61,9 +65,17 @@ MCP for Unity acts as a bridge, allowing AI assistants (like Claude, Cursor) to
6165

6266
Your LLM can retrieve the following resources:
6367

64-
* `unity_instances`: Lists all running Unity Editor instances with their details (name, path, port, status).
65-
* `menu_items`: Retrieves all available menu items in the Unity Editor.
66-
* `tests`: Retrieves all available tests in the Unity Editor. Can select tests of a specific type (e.g., "EditMode", "PlayMode").
68+
* `unity_instances`: Lists all running Unity Editor instances with their details (name, path, port, status).
69+
* `menu_items`: Retrieves all available menu items in the Unity Editor.
70+
* `tests`: Retrieves all available tests in the Unity Editor. Can select tests of a specific type (e.g., "EditMode", "PlayMode").
71+
* `editor_active_tool`: Currently active editor tool (Move, Rotate, Scale, etc.) and transform handle settings.
72+
* `editor_prefab_stage`: Current prefab editing context if a prefab is open in isolation mode.
73+
* `editor_selection`: Detailed information about currently selected objects in the editor.
74+
* `editor_state`: Current editor runtime state including play mode, compilation status, active scene, and selection summary.
75+
* `editor_windows`: All currently open editor windows with their titles, types, positions, and focus state.
76+
* `project_info`: Static project information including root path, Unity version, and platform.
77+
* `project_layers`: All layers defined in the project's TagManager with their indices (0-31).
78+
* `project_tags`: All tags defined in the project's TagManager.
6779
</details>
6880
---
6981

0 commit comments

Comments
 (0)