editor_skill
- C#
44
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill besty0728/unity-skills --skill editor- SKILL.md4.1 KB
Overview
This skill controls Unity Editor state and common editor operations from automation code. It exposes commands to enter/exit play mode, pause, change selection, perform undo/redo, execute menu items, and query editor context like selection, tags, layers, and play/compile status. Use it to script safe, repeatable editor interactions during development or CI automation.
How this skill works
The skill calls Unity Editor APIs to read state and perform actions: toggling play/pause, selecting objects by name or instanceId, undoing/redoing recent operations, and invoking menu commands by exact path. It can return structured context including selected GameObjects, selected assets, active scene info, focused window, and flags such as isPlaying and isCompiling. Menu commands must match Unity’s menu path strings exactly.
When to use it
- Start or stop play mode during automated tests or demonstrations
- Query selection, tags, and layers for tooling or batch edits
- Execute editor menu actions from scripts or automation pipelines
- Safely experiment with scene changes using undo/redo
- Collect full editor context for diagnostics or editor tooling
Best practices
- Check editor state (isCompiling, isPlaying) before running disruptive actions
- Avoid modifying scene objects while in play mode unless changes should be transient
- Use editor_get_context to obtain instanceId and paths for reliable batch operations
- Wrap destructive steps with editor_undo to enable quick rollback
- Provide exact menuPath strings when calling editor_execute_menu to ensure the correct command runs
Example use cases
- Enter play mode, run a sequence, then stop and undo temporary edits
- Select a GameObject by name, fetch its instanceId, and run batch component inspections
- Get full editor context before a CI build to ensure the expected scene and assets are focused
- Run editor_execute_menu("Assets/Refresh") after generating files to make them visible to Unity
- Use editor_get_tags and editor_get_layers to validate project tag/layer configuration in tooling scripts
FAQ
Use editor_get_context with includeChildren or inspect selectedGameObjects to find instanceId or path, then call editor_select with instanceId for an exact match.
What happens if I run play mode commands while the editor is compiling?
Check editor_get_state first; performing play/pause while isCompiling is true can fail or be ignored. Wait for compilation to finish before toggling play mode.