unity-plugin
Control Unity Editor via OpenClaw Unity Plugin. Use for Unity game development tasks including scene management, GameObject/Component manipulation, debugging, input simulation, and Play mode control. Triggers on Unity-related requests like inspecting scenes, creating objects, taking screenshots, testing gameplay, or controlling the Editor.
- License 许可
- MIT
- 最近更新
- 2026-08-23
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- unity-plugin
- description
- Control Unity Editor via OpenClaw Unity Plugin. Use for Unity game development tasks including scene management, GameObject/Component manipulation, debugging, input simulation, and Play mode control. Triggers on Unity-related requests like inspecting scenes, creating objects, taking screenshots, testing gameplay, or controlling the Editor.
02 资源文件 7
- 参考文档_meta.json465 B
- 脚本extension/index.ts13.5 KB
- 参考文档extension/openclaw.plugin.json378 B
- 参考文档extension/package.json189 B
- 参考文档README.md1.8 KB
- 参考文档references/tools.md5.5 KB
- 脚本scripts/install-extension.sh716 B
03 SKILL.md 正文
Unity Plugin Skill
First-Time Setup
If unity_execute tool is not available, install the gateway extension:
# From skill directory
./scripts/install-extension.sh
# Restart gateway
openclaw gateway restart
The extension files are in extension/ directory.
Control Unity Editor through 50 built-in tools. Works in both Editor and Play mode.
Quick Reference
Core Tools
| Category | Key Tools |
|---|---|
| Scene | scene.getActive, scene.getData, scene.load, scene.open |
| GameObject | gameobject.find, gameobject.create, gameobject.destroy, gameobject.delete |
| Component | component.get, component.set, component.add |
| Debug | debug.hierarchy, debug.screenshot, console.getLogs |
| Input | input.clickUI, input.type, input.keyPress |
| Editor | app.play, app.getState, editor.refresh |
Common Workflows
1. Scene Inspection
unity_execute: debug.hierarchy {depth: 2}
unity_execute: scene.getActive
2. Find & Modify Objects
unity_execute: gameobject.find {name: "Player"}
unity_execute: component.get {objectName: "Player", componentType: "Transform"}
unity_execute: transform.setPosition {objectName: "Player", x: 0, y: 5, z: 0}
3. UI Testing
unity_execute: input.clickUI {name: "PlayButton"}
unity_execute: input.type {text: "TestUser", elementName: "UsernameInput"}
unity_execute: debug.screenshot
4. Play Mode Control
unity_execute: app.play {state: true} # Enter Play mode
unity_execute: app.play {state: false} # Exit Play mode
unity_execute: app.getState # Check current state
5. Force Recompile
unity_execute: editor.refresh # Refresh assets & recompile
unity_execute: editor.recompile # Request recompilation only
Tool Categories
Console (3 tools)
console.getLogs- Get logs with optional type filter (Log/Warning/Error)console.getErrors- Get error/exception logs (with optional warnings)console.clear- Clear captured logs
Scene (5 tools)
scene.list- List scenes in build settingsscene.getActive- Get active scene infoscene.getData- Get full hierarchy datascene.load- Load scene by name (Play mode)scene.open- Open scene in Editor mode (EditorSceneManager)
GameObject (7 tools)
gameobject.find- Find by name, tag, or componentgameobject.create- Create object or primitive (Cube, Sphere, etc.)gameobject.destroy- Destroy objectgameobject.delete- Delete object (alias for destroy)gameobject.getData- Get detailed datagameobject.setActive- Enable/disablegameobject.setParent- Change hierarchy
Transform (6 tools)
transform.getPosition- Get world position {x, y, z}transform.getRotation- Get Euler rotation {x, y, z}transform.getScale- Get local scale {x, y, z}transform.setPosition- Set world position {x, y, z}transform.setRotation- Set Euler rotationtransform.setScale- Set local scale
Component (5 tools)
component.add- Add component by type namecomponent.remove- Remove componentcomponent.get- Get component data/propertiescomponent.set- Set field/property valuecomponent.list- List available component types
Script (3 tools)
script.execute- Execute simple commandscript.read- Read script filescript.list- List project scripts
Application (3 tools)
app.getState- Get play mode, FPS, timeapp.play- Enter/exit Play modeapp.pause- Toggle pause
Debug (3 tools)
debug.log- Write to consoledebug.screenshot- Capture screenshotdebug.hierarchy- Text hierarchy view
Editor (4 tools)
editor.refresh- Refresh AssetDatabase (triggers recompile)editor.recompile- Request script recompilationeditor.focusWindow- Focus window (game/scene/console/hierarchy/project/inspector)editor.listWindows- List open windows
Input Simulation (10 tools)
input.keyPress- Press and release keyinput.keyDown/input.keyUp- Hold/release keyinput.type- Type text into fieldinput.mouseMove- Move cursorinput.mouseClick- Click at positioninput.mouseDrag- Drag operationinput.mouseScroll- Scroll wheelinput.getMousePosition- Get cursor positioninput.clickUI- Click UI element by name
Tips
Screenshot Modes
- Play mode:
ScreenCapture- includes all UI overlays - Editor mode:
Camera.main.Render()- no overlay UI - Use
{method: "camera"}for camera-only capture
Finding Objects
gameobject.find {name: "Player"} # By exact name
gameobject.find {tag: "Enemy"} # By tag
gameobject.find {componentType: "Camera"} # By component
Script Recompilation
Unity may not auto-recompile after code changes. Use:
editor.refresh # Full asset refresh + recompile
Play Mode Transitions
- Plugin survives Play mode transitions via SessionState
- If connection lost, wait for auto-reconnect or use Window > OpenClaw Plugin > Force Reconnect
Troubleshooting
| Issue | Solution |
|---|---|
| Tool timeout | Check Unity is responding, try app.getState |
| No connection | Verify openclaw unity status, check gateway |
| Scripts not updating | Use editor.refresh to force recompile |
| Wrong screenshot | Use Play mode for game view with UI |
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, or submitting paper reviews via API at http://150.158.152.82:8000.
git-summary
Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.
agent-constitution
Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.