unity-editor
從命令列控制 Unity 編輯器
開發遊戲時不再需要在 Unity 編輯器和終端機之間來回切換。此技能讓 AI 代理可以直接從命令列控制 Unity,編譯腳本、進入播放模式、擷取螢幕截圖,以及執行除錯程式碼。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“unity-editor”。 編譯我的 Unity 腳本並檢查錯誤
预期结果:
- Running: unityctl asset refresh
- Compilation successful - no errors found
- Scripts compiled in 2.3 seconds
正在使用“unity-editor”。 找出場景中所有的 GameObject
预期结果:
- Found 47 GameObjects in current scene
- Player: at position (12.5, 3.2, 0.0)
- Main Camera: at position (0.0, 5.0, -10.0)
- Directional Light: at rotation (50.0, -30.0, 0.0)
正在使用“unity-editor”。 進入播放模式並擷取螢幕截圖
预期结果:
- Entering play mode...
- Play mode active
- Screenshot saved to project/Screenshots/play_test_001.png
- Exiting play mode... Done
安全审计
安全This skill is a documentation-only file containing no executable code. All 64 static findings are false positives: bash command examples in SKILL.md were misidentified as shell execution, local screenshot capability was flagged as upload, status commands were labeled reconnaissance, and cryptographic patterns matched non-existent code. The skill merely describes how to use the external unityctl CLI tool. All network communication is localhost-only.
风险因素
⚙️ 外部命令 (1)
质量评分
你能构建什么
快速迭代遊戲腳本
在 AI 對話中編輯 C# 腳本,然後立即編譯和測試,無需離開對話流程。
無需切換編輯器即可除錯
從終端機執行除錯程式碼並檢查遊戲物件,同時在同一視窗中查看日誌。
自動化 Unity 編輯器工作流程
腳本化整個 Unity 工作流程,包括編譯、播放模式測試和螢幕截圖擷取,用於 CI/CD 管道。
试试这些提示
我剛修改了 Unity 專案中的一些 C# 腳本。你能編譯它們並顯示任何錯誤嗎?
進入播放模式,等待 5 秒,擷取螢幕截圖,然後退出播放模式
執行 C# 程式碼找到名為 Player 的 GameObject 並回傳其當前位置
執行所有播放模式測試並顯示結果及任何失敗項目
最佳实践
- 在操作前先執行 unityctl status 確認 bridge 和編輯器已連接
- 修改腳本後,在進入播放模式前使用 unityctl asset refresh
- 將複雜的 C# 腳本寫入檔案並使用 -f 旗標執行,以便更好地除錯
避免
- 不要在 Unity 編輯器中執行來自未知來源的不受信任 C# 程式碼
- 避免為同一專案執行多個 bridge 執行個體
- 不要依賴此工具進行正式版本建置 - 請改用 Unity batch mode