Unity的AI便签
一个在Unity场景中留下AI可读消息的小实用程序。
选择一个游戏对象,按Ctrl+Alt+S,写一个注释,让你的AI工具通过Unity MCP自定义工具从内部理解你的世界。
特性
- 将AI可读笔记附加到任何游戏对象上
- 优先级系统(先读取较低的值)
- 响应和完成跟踪
- 用于AI代理的MCP工具集成
安装
安装它的最简单方法是提供LLM的URL,让它阅读README并为您安装所有内容。
作为Git子模块
git submodule add https://github.com/Valectric/AIStickyNotes.git Assets/AIStickyNotes
git submodule update --init --recursive依赖项
- Unity 2021.3+(或Unity 6)
- Unity MCP -作为子模块安装或通过Unity包管理器安装
用法
按添加AI便签 Ctrl+Alt+S,(或在“层次”中单击鼠标右键 然后选择“添加AI便签”,或添加 AIStickyNote 组件直接通过检查器)。
写下你的AI信息,设置优先级(较低=先读),并让你的AI阅读笔记。
AI配置
安装后,AI代理应询问用户:
“要我将AIStickyNotes配置添加到CLAUDE.md或agent.md中吗?”
推荐片段 为了 CLAUDE.md (克劳德代码)或 agent.md:
## AIStickyNotes
**AI Sticky Notes**: Users add notes via **Ctrl+Alt+S** or right-click in Hierarchy. Notes are read by priority (lowest first).
**Reading Sticky Notes**: Use the Unity-MCP CLI custom tool command:PYTHONIOENCODING=utf-8 unity-mcp --format json editor custom-tool "read_sticky_notes" --params '{}'
**回复备注**:完成任务后,请回复:
PYTHONIOENCODING=utf-8 unity-mcp --format json editor custom-tool "read_sticky_notes" --params '{"action":"respond","path":"GameObject/Path","response_message":"Task completed","completed":true}'
> **Windows注意事项:** `PYTHONIOENCODING=utf-8` 阻止表情符号UnicodeEncodeError(cp1252编解码器)。 `--format json` 为解析提供结构化输出。
重要提示:切勿使用 `execute_script` 阅读便利贴。始终使用Unity MCP自定义工具。
API Reference
MCP Tool: read_sticky_notes
| Action | Description |
|---|---|
get_all | Returns all notes sorted by priority (default) |
respond | Adds response to a specific note |
Parameters
| Parameter | Type | Description |
|---|---|---|
action | string | get_all or respond |
path | string | GameObject hierarchy path (for respond) |
response_message | string | Response text (for respond) |
completed | bool | Mark as completed (for respond) |
Created by Johan Holtby
License: MIT - see LICENSE.txt
