Write Unity Editor tooling — EditorWindows, CustomEditor inspectors, PropertyDrawers, Gizmos, Handles, MenuItem. Use for any editor extension task. Triggers — 'editor window', 'custom inspector', 'property drawer', 'gizmo', 'editor tool', 'menu item'.
Resources
1Install
npx skillscat add cuozg/oh-my-unity/unity-code-editor Install via the SkillsCat registry.
unity-code-editor
Write production-quality Unity Editor scripts — custom inspectors, editor windows, property drawers, and scene-view tools.
When to Use
- Building a custom Inspector or window for a component or SO
- Adding Gizmos/Handles for scene-view visualization
- Creating [MenuItem] tools, context menus, or editor utilities
- Writing PropertyDrawers for serialized field rendering
- Automating editor workflows via EditorWindow
Workflow
- Identify — determine the editor extension type needed (window, inspector, drawer, gizmo)
- Locate — find the target MonoBehaviour/SO/struct; read it fully before writing
- Implement — write the editor script using the correct base class and API
- Place — always save to an
Editor/folder (any depth); never in Runtime - Verify — run lsp_diagnostics on new file; fix all errors before declaring done
Rules
- Always save editor scripts under an
Editor/folder (compile-guard) - Never add
using UnityEditorto runtime scripts - Use
[CustomEditor(typeof(X))]on the class, not in a method - Call
base.OnInspectorGUI()before custom GUI unless fully replacing it - Wrap Handles/Gizmos in
#if UNITY_EDITORwhen referenced from runtime code - Use
serializedObject.Update()/ApplyModifiedProperties()around SerializedProperty edits - Use
EditorGUILayoutfor window/inspector GUI;EditorGUIfor fixed-rect drawing - Register EditorWindow via
GetWindow<T>()inside a[MenuItem]static method - Prefer
SerializedPropertyover direct field access to support Undo/Prefab overrides - Use
GUILayout.BeginHorizontal/Verticalfor layout; avoid magic pixel offsets - Add
[InitializeOnLoad]only when truly needed (slows editor startup) - Add null-guards on
targetcasts in OnInspectorGUI - Handle Undo with
Undo.RecordObject(target, "action name")before mutations
Output Format
Production Editor scripts placed under the appropriate Editor/ folder, zero compiler errors, Undo-safe.
Standards
Load unity-standards for coding conventions when writing editor scripts. Key references:
code-standards/naming.md— casing, prefixes, namespace, file namingcode-standards/formatting.md— braces, spacing, line length, regionscode-standards/serialization.md— SerializeField, field:, JsonUtility, SO datacode-standards/lifecycle.md— Awake/Start/OnEnable order, coroutine rulescode-standards/null-safety.md— null checks, TryGet, nullable patterns
Load via read_skill_file("unity-standards", "references/code-standards/<file>").
Reference Files
references/editor-patterns.md— EditorWindow, CustomEditor, PropertyDrawer patterns with minimal boilerplatereferences/gizmos-handles.md— Gizmos, Handles, SceneView patterns and OnDrawGizmos examples
Load references on demand via read_skill_file("unity-code-editor", "references/{file}").