dev-editor-scripting

Automates Unity Editor tasks with MenuItem tools, Custom Inspectors, and AssetPostprocessor hooks.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/Unity-UPM-Packages/Antigravity-skills --skill dev-editor-scripting-unity-upm-packages
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dev-editor-scripting
Source: https://github.com/Unity-UPM-Packages/Antigravity-skills/tree/main/.agents/skills/dev-editor-scripting
Command: npx skills add https://github.com/Unity-UPM-Packages/Antigravity-skills --skill dev-editor-scripting-unity-upm-packages

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Repetitive manual work in the Unity Editor—bulk renaming assets, re-compressing textures, wiring component references across prefabs, and fixing import settings—wastes developer time and invites human error. This Skill replaces those click-heavy workflows with one-click Editor scripts. ## Core Features & Use Cases - Bulk Asset Automation: Generates MenuItem tools under Editor/Tools/ that batch-process textures, prefabs, and audio via AssetDatabase and AssetImporter loops. - Custom Inspectors: Writes CustomEditor classes using SerializedProperty and serializedObject.Update/ApplyModifiedProperties to preserve Undo/Redo and Prefab Override tracking, with runtime debug buttons. - Import Pipeline Hooks: Implements AssetPostprocessor callbacks (e.g., OnPreprocessTexture) to auto-configure sprites and assets on import. - MCP Fallback: When a Unity MCP Server operation fails on complex serialized structures, it pivots to an ephemeral Editor script that completes the setup in one click. - Use Case: You need to compress 200 UI sprites for mobile. Instead of editing each importer manually, the Skill generates a Compress All UI Sprites menu tool that sets crunch compression and reimports everything in one click. ## Quick Start Write a Unity Editor menu tool that batch-compresses all textures under Assets/Art/UI with crunch compression enabled.

Frequently Asked Questions about dev-editor-scripting

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

FAQPage Schema
How do I automate bulk asset changes in Unity Editor?▼

Write a static method with a [MenuItem] attribute that uses AssetDatabase.FindAssets to locate assets, then modifies each through its AssetImporter and calls SaveAndReimport. Place the script in an Editor folder so it is excluded from builds.

How to write a Custom Inspector in Unity with Undo support?▼

Create a class deriving from Editor with the [CustomEditor] attribute, cache SerializedProperty fields in OnEnable, and wrap GUI code between serializedObject.Update and ApplyModifiedProperties. Never modify target fields by casting directly, as that breaks Undo and Prefab Override tracking.

Why does my Unity build fail with UnityEditor namespace errors?▼

Builds fail because UnityEditor APIs are unavailable in player builds. Fix it by placing the script inside any folder named Editor, or wrapping the code in #if UNITY_EDITOR preprocessor directives.

Can Unity auto-configure import settings for new assets?▼

Yes, by subclassing AssetPostprocessor and overriding callbacks like OnPreprocessTexture. Check the assetPath to target specific folders, then set importer properties such as textureType, spritePixelsPerUnit, and mipmapEnabled before import completes.

When should I use an Editor script instead of Unity MCP?▼

Use an Editor script fallback when the MCP Server fails on complex serialized structures like nested prefab arrays or ScriptableObject graph links. A one-click MenuItem tool using SerializedObject and PrefabUtility.SavePrefabAsset completes the wiring deterministically.