{"skill":{"slug":"unity-plugin","displayName":"Unity Plugin","summary":"Control Unity Editor via OpenClaw Unity Plugin. Use for Unity game development tasks including scene management, GameObject/Component manipulation, debugging...","description":"---\nname: unity-plugin\nversion: 1.6.1\ndescription: 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.\nhomepage: https://github.com/TomLeeLive/openclaw-unity-skill\nauthor: Tom Jaejoon Lee\ndisableModelInvocation: true\n---\n\n# Unity Plugin Skill\n\nControl Unity Editor through **~100 built-in tools**. Works in both Editor and Play mode.\n\n## Connection Modes\n\n### 1. OpenClaw Gateway (Remote)\nFor Telegram, Discord, and other OpenClaw channels:\n- Auto-connects when Unity opens\n- Configure in: Window → OpenClaw Plugin → Settings\n\n### 2. MCP Bridge (Local)\nFor Claude Code, Cursor, and local AI tools:\n- Start: Window → OpenClaw Plugin → MCP Bridge → Start\n- Default port: 27182\n- Add to Claude Code: `claude mcp add unity -- node <path>/MCP~/index.js`\n\n## First-Time Setup\n\nIf `unity_execute` tool is not available, install the gateway extension:\n\n```bash\n# From skill directory\n./scripts/install-extension.sh\n\n# Restart gateway\nopenclaw gateway restart\n```\n\nThe extension files are in `extension/` directory.\n\n### What install-extension.sh Does\n\n```bash\n# 1. Copies extension files from skill to gateway\n#    Source: <skill>/extension/\n#    Destination: ~/.openclaw/extensions/unity/\n\n# 2. Files installed:\n#    - index.ts     # Extension entry point (HTTP handlers, tools)\n#    - package.json # Extension metadata\n\n# After installation, restart gateway to load the extension.\n```\n\n## 🔐 Security\n\n이 스킬은 `disableModelInvocation: true`로 설정되어 있습니다.\n- AI가 자동으로 도구를 호출하지 않음\n- 사용자가 명시적으로 요청한 작업만 실행\n\n설정 변경 방법은 [README.md](README.md)를 참조하세요.\n\n## Quick Reference\n\n### Core Tools\n\n| Category | Key Tools |\n|----------|-----------|\n| **Scene** | `scene.getActive`, `scene.getData`, `scene.load`, `scene.open`, `scene.save` |\n| **GameObject** | `gameobject.find`, `gameobject.getAll`, `gameobject.create`, `gameobject.destroy` |\n| **Component** | `component.get`, `component.set`, `component.add`, `component.remove` |\n| **Transform** | `transform.setPosition`, `transform.setRotation`, `transform.setScale` |\n| **Debug** | `debug.hierarchy`, `debug.screenshot`, `console.getLogs` |\n| **Input** | `input.clickUI`, `input.type`, `input.keyPress`, `input.mouseClick` |\n| **Editor** | `editor.getState`, `editor.play`, `editor.stop`, `editor.refresh` |\n| **Material** | `material.create`, `material.assign`, `material.modify`, `material.getInfo` |\n| **Prefab** | `prefab.create`, `prefab.instantiate`, `prefab.open`, `prefab.save` |\n| **Asset** | `asset.find`, `asset.copy`, `asset.move`, `asset.delete` |\n| **Package** | `package.add`, `package.remove`, `package.list`, `package.search` |\n| **Test** | `test.run`, `test.list`, `test.getResults` |\n\n## Common Workflows\n\n### 1. Scene Inspection\n\n```\nunity_execute: debug.hierarchy {depth: 2}\nunity_execute: scene.getActive\n```\n\n### 2. Find & Modify Objects\n\n```\nunity_execute: gameobject.find {name: \"Player\"}\nunity_execute: component.get {name: \"Player\", componentType: \"Transform\"}\nunity_execute: transform.setPosition {name: \"Player\", x: 0, y: 5, z: 0}\n```\n\n### 3. UI Testing\n\n```\nunity_execute: input.clickUI {name: \"PlayButton\"}\nunity_execute: input.type {text: \"TestUser\", elementName: \"UsernameInput\"}\nunity_execute: debug.screenshot\n```\n\n### 4. Play Mode Control\n\n```\nunity_execute: editor.play              # Enter Play mode\nunity_execute: editor.stop              # Exit Play mode\nunity_execute: editor.getState          # Check current state\nunity_execute: editor.pause             # Pause\nunity_execute: editor.unpause           # Resume\n```\n\n### 5. Material Creation\n\n```\nunity_execute: material.create {name: \"RedMetal\", color: \"#FF0000\", metallic: 0.8}\nunity_execute: material.assign {gameObjectName: \"Player\", materialPath: \"Assets/Materials/RedMetal.mat\"}\nunity_execute: material.modify {path: \"Assets/Materials/RedMetal.mat\", metallic: 1.0, emission: \"#FF4444\"}\n```\n\n### 6. Prefab Workflow\n\n```\nunity_execute: prefab.create {gameObjectName: \"Player\", path: \"Assets/Prefabs/Player.prefab\"}\nunity_execute: prefab.instantiate {prefabPath: \"Assets/Prefabs/Player.prefab\", x: 0, y: 1, z: 0}\nunity_execute: prefab.open {path: \"Assets/Prefabs/Player.prefab\"}\nunity_execute: prefab.save\nunity_execute: prefab.close\n```\n\n### 7. Asset Management\n\n```\nunity_execute: asset.find {query: \"Player\", type: \"Prefab\"}\nunity_execute: asset.copy {sourcePath: \"Assets/Prefabs/Player.prefab\", destPath: \"Assets/Backup/Player.prefab\"}\nunity_execute: asset.move {sourcePath: \"Assets/Old/Item.prefab\", destPath: \"Assets/New/Item.prefab\"}\n```\n\n### 8. Package Management\n\n```\nunity_execute: package.list\nunity_execute: package.search {query: \"TextMeshPro\"}\nunity_execute: package.add {packageName: \"com.unity.textmeshpro\"}\nunity_execute: package.add {gitUrl: \"https://github.com/example/package.git\"}\n```\n\n### 9. Test Running\n\n```\nunity_execute: test.list {testMode: \"EditMode\"}\nunity_execute: test.run {testMode: \"EditMode\", filter: \"PlayerTests\"}\nunity_execute: test.getResults\n```\n\n### 10. Script Execution (Enhanced)\n\n```\n# Debug logging\nunity_execute: script.execute {code: \"Debug.Log('Hello')\"}\n\n# Time manipulation\nunity_execute: script.execute {code: \"Time.timeScale = 0.5\"}\n\n# PlayerPrefs\nunity_execute: script.execute {code: \"PlayerPrefs.SetInt('score', 100)\"}\n\n# Reflection-based method calls\nunity_execute: script.execute {code: \"MyClass.MyMethod()\"}\nunity_execute: script.execute {code: \"MyClass.MyStaticMethod('param1', 123)\"}\n```\n\n## Tool Categories (~100 tools)\n\n### Console (3 tools)\n- `console.getLogs` - Get logs with optional type filter (Log/Warning/Error)\n- `console.getErrors` - Get error/exception logs (with optional warnings)\n- `console.clear` - Clear captured logs\n\n### Scene (7 tools)\n- `scene.list` - List scenes in build settings\n- `scene.getActive` - Get active scene info\n- `scene.getData` - Get full hierarchy data\n- `scene.load` - Load scene by name (Play mode)\n- `scene.open` - Open scene in Editor mode\n- `scene.save` - Save active scene (Editor mode)\n- `scene.saveAll` - Save all open scenes (Editor mode)\n\n### GameObject (8 tools)\n- `gameobject.find` - Find by name, tag, or component\n- `gameobject.getAll` - Get all GameObjects with filtering\n- `gameobject.create` - Create object or primitive (Cube, Sphere, etc.)\n- `gameobject.destroy` - Destroy object\n- `gameobject.delete` - Delete object (alias for destroy)\n- `gameobject.getData` - Get detailed data\n- `gameobject.setActive` - Enable/disable\n- `gameobject.setParent` - Change hierarchy\n\n### Transform (6 tools)\n- `transform.getPosition` - Get world position {x, y, z}\n- `transform.getRotation` - Get Euler rotation {x, y, z}\n- `transform.getScale` - Get local scale {x, y, z}\n- `transform.setPosition` - Set world position {x, y, z}\n- `transform.setRotation` - Set Euler rotation\n- `transform.setScale` - Set local scale\n\n### Component (5 tools)\n- `component.add` - Add component by type name\n- `component.remove` - Remove component\n- `component.get` - Get component data/properties\n- `component.set` - Set field/property value\n- `component.list` - List available component types\n\n### Script (3 tools)\n- `script.execute` - Execute code: Debug.Log, Time, PlayerPrefs, **reflection calls**\n- `script.read` - Read script file\n- `script.list` - List project scripts\n\n### Application (4 tools)\n- `app.getState` - Get play mode, FPS, time\n- `app.play` - Enter/exit Play mode\n- `app.pause` - Toggle pause\n- `app.stop` - Stop Play mode\n\n### Debug (3 tools)\n- `debug.log` - Write to console\n- `debug.screenshot` - Capture screenshot\n- `debug.hierarchy` - Text hierarchy view\n\n### Editor (9 tools)\n- `editor.refresh` - Refresh AssetDatabase (triggers recompile)\n- `editor.recompile` - Request script recompilation\n- `editor.domainReload` - Force domain reload\n- `editor.focusWindow` - Focus window (game/scene/console/hierarchy/project/inspector)\n- `editor.listWindows` - List open windows\n- `editor.getState` - Get editor state\n- `editor.play` - Enter Play mode\n- `editor.stop` - Exit Play mode\n- `editor.pause` / `editor.unpause` - Pause control\n\n### Input Simulation (10 tools)\n- `input.keyPress` - Press and release key\n- `input.keyDown` / `input.keyUp` - Hold/release key\n- `input.type` - Type text into field\n- `input.mouseMove` - Move cursor\n- `input.mouseClick` - Click at position\n- `input.mouseDrag` - Drag operation\n- `input.mouseScroll` - Scroll wheel\n- `input.getMousePosition` - Get cursor position\n- `input.clickUI` - Click UI element by name\n\n### Material (5 tools) - NEW in v1.5.0\n- `material.create` - Create material with shader, color, metallic, smoothness\n- `material.assign` - Assign material to GameObject\n- `material.modify` - Modify material properties (color, metallic, emission)\n- `material.getInfo` - Get detailed material info with all shader properties\n- `material.list` - List materials in project with filtering\n\n### Prefab (5 tools) - NEW in v1.5.0\n- `prefab.create` - Create prefab from scene GameObject\n- `prefab.instantiate` - Instantiate prefab in scene with position\n- `prefab.open` - Open prefab for editing\n- `prefab.close` - Close prefab editing mode\n- `prefab.save` - Save currently edited prefab\n\n### Asset (7 tools) - NEW in v1.5.0\n- `asset.find` - Search assets by query, type, folder\n- `asset.copy` - Copy asset to new path\n- `asset.move` - Move/rename asset\n- `asset.delete` - Delete asset (with trash option)\n- `asset.refresh` - Refresh AssetDatabase\n- `asset.import` - Import/reimport specific asset\n- `asset.getPath` - Get asset path by name\n\n### Package Manager (4 tools) - NEW in v1.5.0\n- `package.add` - Install package by name or git URL\n- `package.remove` - Remove installed package\n- `package.list` - List installed packages\n- `package.search` - Search Unity package registry\n\n### Test Runner (3 tools) - NEW in v1.5.0\n- `test.run` - Run EditMode/PlayMode tests with filtering\n- `test.list` - List available tests\n- `test.getResults` - Get last test run results\n\n### Batch Execution (1 tool) - NEW in v1.6.0\n- `batch.execute` - Execute multiple tools in one call (10-100x performance)\n  - `commands`: Array of {tool, params} objects\n  - `stopOnError`: Stop on first error (default: false)\n\n### Session (1 tool) - NEW in v1.6.0\n- `session.getInfo` - Get session info (project, processId, machineName, sessionId)\n\n### ScriptableObject (6 tools) - NEW in v1.6.0\n- `scriptableobject.create` - Create new ScriptableObject asset\n- `scriptableobject.load` - Load and inspect ScriptableObject fields\n- `scriptableobject.save` - Save ScriptableObject changes\n- `scriptableobject.getField` - Get specific field value\n- `scriptableobject.setField` - Set field value with auto-save\n- `scriptableobject.list` - List ScriptableObjects in project\n\n### Shader (3 tools) - NEW in v1.6.0\n- `shader.list` - List shaders in project\n- `shader.getInfo` - Get shader properties and info\n- `shader.getKeywords` - Get shader keywords\n\n### Texture (5 tools) - NEW in v1.6.0\n- `texture.create` - Create new texture with color fill\n- `texture.getInfo` - Get texture info (size, format, import settings)\n- `texture.setPixels` - Fill region with color\n- `texture.resize` - Resize texture via import settings\n- `texture.list` - List textures in project\n\n## Custom Tools API - v1.6.0\n\nRegister project-specific tools:\n\n```csharp\nOpenClawCustomTools.Register(\n    \"mygame.getScore\",\n    \"Get current score\",\n    (args) => new { success = true, score = GameManager.Score }\n);\n```\n\n## MCP Resources - v1.6.0\n\nAccess Unity data via MCP resource URIs:\n\n| URI | Description |\n|-----|-------------|\n| `unity://scene/hierarchy` | Scene hierarchy |\n| `unity://scene/active` | Active scene info |\n| `unity://project/scripts` | Script list |\n| `unity://project/scenes` | Scene list |\n| `unity://editor/state` | Editor state |\n| `unity://console/logs` | Console logs |\n| `unity://session/info` | Session info |\n\n## Tips\n\n### Screenshot Modes\n- **Play mode**: `ScreenCapture` - includes all UI overlays\n- **Editor mode**: `Camera.main.Render()` - no overlay UI\n- Use `{method: \"camera\"}` for camera-only capture\n\n### Finding Objects\n```\ngameobject.find {name: \"Player\"}           # By exact name\ngameobject.find {tag: \"Enemy\"}             # By tag\ngameobject.find {componentType: \"Camera\"}  # By component\ngameobject.getAll {activeOnly: true}       # All active objects\n```\n\n### Script Recompilation\nUnity may not auto-recompile after code changes. Use:\n```\neditor.refresh    # Full asset refresh + recompile\n```\n\n### Play Mode Transitions\n- Plugin survives Play mode transitions via SessionState\n- If connection lost, wait for auto-reconnect or use Window → OpenClaw Plugin → Settings → Connect\n\n### MCP Bridge Usage\nFor Claude Code / Cursor integration:\n1. Start: Window → OpenClaw Plugin → MCP Bridge → Start\n2. Register: `claude mcp add unity -- node /path/to/MCP~/index.js`\n3. Verify: `curl http://127.0.0.1:27182/status`\n\n### Input Simulation Limitation\nKeyboard/mouse simulation works for **UI interactions** but NOT for `Input.GetKey()`. For gameplay testing:\n- Use `transform.setPosition` to move objects directly\n- Or migrate to Unity's **new Input System**\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Tool timeout | Check Unity is responding, try `editor.getState` |\n| Gateway no connection | Check Window → OpenClaw Plugin → Settings |\n| MCP no connection | Start MCP Bridge, verify port 27182 |\n| Scripts not updating | Use `editor.refresh` to force recompile |\n| Wrong screenshot | Use Play mode for game view with UI |\n| MCP 504 timeout | Unity busy or MCP Bridge not started |\n| Test Runner not found | Install `com.unity.test-framework` package |\n\n## Links\n\n- **Skill Repository:** https://github.com/TomLeeLive/openclaw-unity-skill\n- **Plugin Repository:** https://github.com/TomLeeLive/openclaw-unity-plugin\n- **OpenClaw Docs:** https://docs.openclaw.ai\n- **MCP Setup Guide:** See Plugin Repository → Documentation~/SETUP_GUIDE.md\n\n## License\n\nMIT License - See LICENSE file\n","topics":["Game","Debugging"],"tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":427,"installsAllTime":16,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1777883411733,"updatedAt":1779076228697},"latestVersion":{"version":"1.0.0","createdAt":1777883411733,"changelog":"Initial release of Unity Plugin Skill for OpenClaw.\n\n- Control Unity Editor using ~100 built-in tools for scenes, GameObjects, components, assets, materials, prefabs, editor, input, and more.\n- Works via remote (OpenClaw Gateway) and local (MCP Bridge) connection modes.\n- Includes step-by-step setup and installation guide for skill extension.\n- Comprehensive tool reference tables and categorized workflow examples for common Unity tasks.\n- Enhanced security: disables automated tool invocation; only runs explicitly requested commands.\n- Provides guidance for installation, configuration, and supported command syntax.","license":"MIT-0"},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"mlichao456","userId":"s177wmzfh10k7ypx24mzwcqkv98634db","displayName":"mlichao456","image":"https://avatars.githubusercontent.com/u/22606184?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780090740859}}