Unity Editor logo

Unity Editor

CommunityPopular
Besty0728
unity-editor

Control and observe the Unity Editor state

Overview

PublisherBesty0728
RepositoryUnity-Skills
Skill nameunity-editor
Stars
1.8K
Forks
164
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Besty0728 on GitHub. Read the source before you install it.

Installation

Install the Unity Editor AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.

Use it in TypingMind

Enable Unity Editor in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Unity Editor on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Unity Editor is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via GET /skills/recommend?includeSchema=true) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.

Triggers

  • Reading persistent scene/file changes
  • Driving play mode
  • Inspecting runtime state
  • Executing menu items
  • 读取持久化场景/文件变更、操控 Play Mode、检查运行时状态、执行菜单项

Unity Editor Skills

Observe and control the Unity Editor without parsing scene YAML.

Operating Mode

  • Approval:本模块 Mixed —— editor_get_changes / editor_get_selection / editor_get_context / editor_get_state / editor_get_tags / editor_get_layers / editor_playmode_inspectSkillMode.SemiAuto,可直接执行;其余 editor_select / editor_undo / editor_redo / editor_playmode_step 默认 FullAuto,Approval 模式下需 grant。
  • Auto / Bypass:FullAuto 直接执行。
  • 含 NeverInSemi 高危 skilleditor_play / editor_play_capture / editor_stop / editor_pause(标 MayEnterPlayMode = true);editor_execute_menu(标 MayTriggerReload = true —— Assets/RefreshAssets/Reimport All 之类的菜单项会触发域重载)。这些在 Approval Auto 下都返 MODE_FORBIDDEN,仅 Bypass 或 Allowlist 命中可调;grant 流程对它们不适用,不要尝试。

DO NOT (common hallucinations):

  • editor_run does not exist → use editor_play to enter play mode
  • editor_compile / editor_recompile do not exist → use debug_force_recompile
  • editor_save does not exist → use editor_execute_menu with menuPath "File/Save"
  • editor_execute_menu requires exact menu path — typos cause silent failure

Routing:

  • For compilation check → use debug module's debug_check_compilation
  • For console errors → use debug module's debug_get_errors
  • For scene save → scene_save (scene module) or editor_execute_menu menuPath="File/Save"
  • When file watching reports changes, or the AI resumes after the user edited Unity → call editor_get_changes before reading .unity YAML
  • If editor_get_changes.dropped=true → its 500-entry retention window was exceeded; rebuild context with scene_context / scene_diff

Skills Overview

SkillDescription
editor_playEnter play mode
editor_play_captureObserve runtime errors, optionally screenshot, then exit
editor_stopExit play mode
editor_pauseToggle pause
editor_playmode_stepAdvance Play Mode by N frames (async job)
editor_playmode_inspectInspect a GameObject's live runtime state (transform, component fields)
editor_selectSelect GameObject
editor_get_selectionGet selected objects
editor_get_contextGet full editor context (selection, assets, scene)
editor_get_changesRead persistent scene/file changes by cursor
editor_undoUndo last action
editor_redoRedo last action
editor_get_stateGet editor state
editor_execute_menuExecute menu item
editor_get_tagsGet all tags
editor_get_layersGet all layers
console_set_pause_on_errorPause play mode on error (console module)

Skills

editor_play

Enter play mode. Warning: any unsaved scene changes made during Play mode will be lost when exiting.

Returns: {success, mode, jobId}mode="playing", jobId returned from AsyncJobService so callers can poll entering_play_mode completion.

editor_play_capture

Enter Play Mode, observe errors for durationSeconds (default 10, range 1–300), optionally capture the Game View, then exit. Returns a Job whose result includes healthy, error aggregates, stoppedEarly, and screenshotPath.

editor_stop

Exit play mode.

Returns: {success, mode}mode="stopped".

editor_pause

Toggle pause state.

Returns: {success, paused}paused is the new boolean state.

editor_playmode_step

Advance Play Mode forward by frames (1–100, default 1) using EditorApplication.Step; Unity automatically enters paused state as part of stepping. Requires Play Mode to already be active — call editor_play or editor_play_capture first, otherwise this returns a structured error (error + hint + suggestedSkills: ["editor_play", "editor_play_capture"]). Only one step job may be in flight at a time; a second call while one is still running returns an error naming the active jobId.

ParameterTypeRequiredDefaultDescription
framesintNo1Frames to advance, clamped to 1–100

Runs as an async job, not synchronously: EditorApplication.Step() only lands on a later Editor tick, so the skill issues one Step() call at a time, confirms it landed by watching Time.frameCount advance, and only then issues the next — back-to-back Step() calls without that confirmation are not reliable. The call itself returns immediately: {success, status: "accepted", jobId, framesRequested}.

Poll job_status with the returned jobId until status="completed"; its details then contains {framesRequested, framesCompleted, frameCount, isPaused}. Do not use job_wait — like playmode/play_capture, this job's progress depends on EditorApplication.update ticks, and job_wait's blocking loop runs on the same main thread those ticks come from, so it cannot observe progress; it will just spend its full timeout doing nothing. If Play Mode exits or Unity fails to advance a frame within 10s, the job fails with failed_exited_play_mode / failed_step_timeout.

editor_playmode_inspect

Inspect a GameObject's live runtime state: transform (position/rotation/scale), activeSelf/activeInHierarchy, and — when componentType is given — that component's public fields and properties (reuses the same reflection helper as component_get_properties, not reimplemented). Works during Play Mode, including while paused, and also in Edit Mode, where it returns editor-time values — check isPlaying/isPaused in the response to know which state the values reflect.

ParameterTypeRequiredDescription
namestringNo*Object name
instanceIdintNo*Instance ID (preferred)
pathstringNo*Object path
componentTypestringNoComponent type name; when set, also returns its public fields/properties

*One identifier required

Returns: {success, gameObject, entityId, instanceId, path, activeSelf, activeInHierarchy, transform: {position, localPosition, rotation, localScale}, isPlaying, isPaused, component}. component is null when componentType is omitted, an error object when the type isn't found or isn't attached, or {gameObject, component, fullTypeName, properties, fields} (same shape as component_get_properties) otherwise.

editor_select

Select a GameObject.

ParameterTypeRequiredDescription
namestringNo*Object name
instanceIdintNo*Instance ID (preferred)
pathstringNo*Object path

*One identifier required

editor_get_selection

Get currently selected objects.

Returns: {count, objects: [{name, instanceId}]}

editor_get_context

Get full editor context including selection, assets, and scene info.

ParameterTypeRequiredDefaultDescription
includeComponentsboolNofalseInclude component list
includeChildrenboolNofalseInclude children info

Returns:

  • selectedGameObjects: Objects in Hierarchy (instanceId, path, tag, layer)
  • selectedAssets: Assets in Project window (GUID, path, type, isFolder)
  • activeScene: Current scene info (name, path, isDirty)
  • focusedWindow: Name of focused editor window
  • isPlaying, isCompiling: Editor state

editor_get_changes

Read the persistent change journal at Library/UnitySkills/editor_changes.jsonl. It captures scene object/component/property summaries plus imported, deleted, and moved asset paths across Domain Reloads. It never parses or returns raw .unity YAML.

ParameterTypeRequiredDefaultDescription
sincelongNo0Previous response cursor; 0 reads retained history
typesstringNoallComma-separated scene, file, undo, or lifecycle
sourcestringNoalleditor/manual, rest, or all
limitintNo100Newest entries to return, 1-500

Returns: {hasChanges, cursor, oldestSeq, dropped, truncated, changes}. Save cursor for the next call. dropped=true means older changes fell outside the 500-entry journal, so rebuild full scene context.

editor_undo

Undo the last action.

editor_redo

Redo the last undone action.

editor_get_state

Get current editor state.

Returns: {isPlaying, isPaused, isCompiling, timeSinceStartup, unityVersion, platform}

editor_execute_menu

Execute a menu command.

ParameterTypeRequiredDescription
menuPathstringYesMenu item path

Common Menu Paths:

Menu PathAction
File/SaveSave current scene
File/Build Settings...Open build settings
Edit/PlayToggle play mode
GameObject/Create EmptyCreate empty object
Window/General/ConsoleOpen console
Assets/RefreshRefresh assets

editor_get_tags

Get all available tags.

Returns: {tags: [string]}

editor_get_layers

Get all available layers.

Returns: {layers: [{index, name}]}

Pause On Error

Pause-on-error is provided by the console module, not the editor module.

Use console_set_pause_on_error from console/SKILL.md.


Example Usage

python
import unity_skills

# Check editor state before operations
state = unity_skills.call_skill("editor_get_state")
if state['isCompiling']:
    print("Wait for compilation to finish")

# On resume or after file-watch notification, inspect semantic changes first.
changes = unity_skills.call_skill("editor_get_changes", since=last_cursor)
last_cursor = changes["cursor"]

# Get full context (useful for understanding current state)
context = unity_skills.call_skill("editor_get_context", includeComponents=True)
for obj in context['selectedGameObjects']:
    print(f"Selected: {obj['name']} (ID: {obj['instanceId']})")

# Select and operate on object
unity_skills.call_skill("editor_select", name="Player")
selection = unity_skills.call_skill("editor_get_selection")

# Safe experimentation with undo
unity_skills.call_skill("gameobject_delete", name="TestObject")
unity_skills.call_skill("editor_undo")  # Restore if needed

# Execute menu command
unity_skills.call_skill("editor_execute_menu", menuPath="File/Save")

# Step through Play Mode frame-by-frame and assert state changed
import time

# Enter Play Mode with a generous observation window so there's time left to step
capture = unity_skills.call_skill("editor_play_capture", durationSeconds=30)
while True:
    capture_status = unity_skills.call_skill("job_status", jobId=capture["jobId"])
    if capture_status["currentStage"] not in ("entering_play_mode", "domain_reload_recovery"):
        break  # Play Mode has been entered; capture_status["currentStage"] == "observing"
    time.sleep(0.2)

before = unity_skills.call_skill("editor_playmode_inspect", name="Player")["transform"]["position"]

step = unity_skills.call_skill("editor_playmode_step", frames=3)
while True:
    step_status = unity_skills.call_skill("job_status", jobId=step["jobId"])  # not job_wait, see above
    if step_status["status"] in ("completed", "failed"):
        break
    time.sleep(0.1)

after = unity_skills.call_skill("editor_playmode_inspect", name="Player")["transform"]["position"]
assert after != before, "Player did not move after 3 frames"
print(step_status["details"]["frameCount"], step_status["details"]["isPaused"])

Best Practices

  1. Check editor state before play mode operations
  2. Don't modify scene during play mode (changes lost)
  3. Use undo for safe experimentation
  4. On resume, call editor_get_changes before reading scene files
  5. Use editor_get_context to get instanceId for batch operations
  6. Menu commands must match exact paths

Exact Signatures

Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.

Common Errors

Full transport-level codes (COMPILING/RATE_LIMIT etc.) → ../../references/protocol-error-codes.md

ErrorTriggerFix
TARGET_NOT_FOUNDThe requested GameObject or menu item could not be found (e.g., Menu item not found or failed).Verify the object with gameobject_find / scene_get_hierarchy, or check the exact menu path spelling before retrying.
SKILL_ERRORA play-mode state conflict occurred, such as Already in play mode, Not in play mode, or an active frame-step job already exists.Match the editor state to the skill requirement: enter/exit play mode first, or wait for the existing step job to finish.

Frequently asked questions

What does the Unity Editor AI skill do?

Control and observe the Unity Editor state

Why use Unity Editor on TypingMind?

Because you install it once and use it with any model. Unity Editor is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Unity Editor in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/editor. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Unity Editor?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Unity Editor?

As many as you like. As long as a model supports skills, you can use Unity Editor with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Unity Editor AI skill free?

Yes. It is published on GitHub by Besty0728 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇