unity-editor

Control Unity Editor play mode, selection, undo/redo, and menu commands programmatically.

Updated Jun 21, 2026
One-click install
npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-editor-du-qwq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-editor
Source: https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications/tree/main/.agents/skills/unity-skills/skills/editor
Command: npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-editor-du-qwq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Automating Unity Editor state changes—entering play mode, selecting objects, undoing actions, or running menu commands—normally requires manual clicks or custom editor scripts. This Skill exposes those operations as callable functions so an AI agent can drive the Editor directly. ## Core Features & Use Cases - Play Mode Control: Enter, exit, and pause play mode with editor_play, editor_stop, and editor_pause, including job IDs for polling async state transitions. - Selection & Context Inspection: Select GameObjects by name, instanceId, or path, and retrieve full editor context (selected objects, assets, active scene, focused window) via editor_get_context. - Undo/Redo & Menu Execution: Safely experiment with editor_undo/editor_redo and run any menu command through editor_execute_menu using exact paths like "File/Save". - Use Case: Ask the agent to select the "Player" GameObject, verify the editor is not compiling, then enter play mode to test a scene—without touching the Unity UI. ## Quick Start Ask the agent to check the current Unity editor state and then enter play mode if compilation has finished.

Frequently Asked Questions about unity-editor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enter play mode in Unity Editor programmatically?

Call editor_play to enter play mode; it returns a mode of "playing" plus a jobId you can poll to track the entering_play_mode transition. Use editor_stop to exit and editor_pause to toggle pause.

How to select a GameObject in Unity from a script or agent?

Use editor_select with one identifier: name, instanceId, or path. The instanceId is preferred for precision, and you can retrieve it first via editor_get_context or editor_get_selection.

Why does editor_execute_menu fail silently in Unity?

editor_execute_menu requires the exact menu path, such as "File/Save" or "Window/General/Console". Any typo causes silent failure, so copy paths verbatim from the documented common menu paths table.

Can I save the Unity scene or trigger recompilation with this skill?

There is no editor_save or editor_compile command. Save via editor_execute_menu with menuPath "File/Save" or the scene module's scene_save, and use the debug module's debug_force_recompile for compilation.

Why is editor_play forbidden in Approval or Auto mode?

editor_play, editor_stop, and editor_pause are flagged MayEnterPlayMode because play mode transitions discard unsaved runtime changes. They return MODE_FORBIDDEN under Approval/Auto and only run in Bypass mode or when allowlisted.