uw-unity-editor-tools
Skill44 starsChanged 8 months agoMITView on GitHub
Generate custom editor tooling including Custom Inspectors, PropertyDrawers, EditorWindows, Gizmos, and Handles. Use when building designer-facing tools, spatial visualization, batch operations, or custom component UIs. Triggers on requests like "create a custom inspector", "add gizmos", "build an editor window", "make this component designer-friendly", "add a debug visualization", "create a level editor tool", "add a property drawer", "make a batch rename tool", or any editor tooling work. Always uses SerializedProperty and Undo for safety.
In this repository13 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- uw-code-reviewSkill
- uw-dependency-injectionSkill
- uw-game-feel-integratorSkill
- uw-network-setupSkill
- uw-scriptable-object-archSkill
- uw-skill-creatorSkill
- uw-state-machineSkill
- uw-ui-toolkit-binderSkill
- uw-unity-debuggingSkill
- uw-unity-feature-scaffoldSkill
- uw-unity-project-setupSkill
- uw-unity-test-runnerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Check if the feature has an Editor/ asmdef — if not, create one.
- Very specific: line 17
Read docs/NAMING_CONVENTIONS.md for editor script naming.
- Distinctive: line 109
Never be referenced by Runtime assemblies
- Distinctive: line 113
Add pre-build validators to catch issues before shipping.
- Very specific: line 137
Debug visualization: Use uw-unity-debugging Gizmos for debug-specific visualizations (raycast paths, trigger volumes, AI sight cones).
- Very specific: line 138
Write tests: Use uw-unity-test-runner — test editor tools in EditMode (validate that SerializedProperty operations produce correct results).
- Very specific: line 139
SO inspectors: Use uw-scriptable-object-arch data containers with custom inspectors for designer-friendly data editing.
- Very specific: line 140
UI Toolkit binding: Use uw-ui-toolkit-binder patterns if building editor windows with data binding.
- Distinctive: line 146
Build alongside features: Don't wait for a "tooling phase." Build the inspector while the component is being created.
- Very specific: line 150
Always use SerializedProperty for inspector fields — never direct field access.
- Distinctive: line 151
Always record Undo before any state modification.
- Very specific: line 152
Always serializedObject.ApplyModifiedProperties() at the end of inspector OnInspectorGUI.
- Distinctive: line 154
Never reference Editor assemblies from Runtime assemblies.
- Very specific: line 156
If ProjectConfig.yaml -> mcp.unity_mcp is true, call refresh_unity after creating files.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Unity Editor Tools
Generate editor tooling that follows Unity best practices.
Before You Start
- Read
docs/ProjectConfig.yamlfor:unity_version— UI Toolkit editor UI requires 2022.2+ (all Unity 6+ projects qualify).ui_system— if"UIToolkit"or"Mixed", prefer UI Toolkit for editor UIs too (consistent approach).mcp.unity_mcp— iftrue, callrefresh_unityafter creating files.
- Check if the feature has an
Editor/asmdef — if not, create one. The Editor asmdef must reference the Runtime asmdef and haveEditoras its only Include Platform. - Read
docs/NAMING_CONVENTIONS.mdfor editor script naming.
Core Rules (Non-Negotiable)
// ALWAYS: Use SerializedProperty for inspector fields
SerializedProperty _healthProp;
void OnEnable() => _healthProp = serializedObject.FindProperty("_health");
// NEVER: Direct field access (breaks multi-edit, prefabs, undo)
((MyComponent)target)._health = EditorGUILayout.FloatField(((MyComponent)target)._health);// ALWAYS: Record undo before modifications
Undo.RecordObject(target, "Changed patrol point");
myComponent.patrolPoints[i] = newPos;
// NEVER: Modify without undo
myComponent.patrolPoints[i] = newPos;// ALWAYS: Mark dirty after changes in tools
EditorUtility.SetDirty(target);
// ALWAYS: Apply modified properties in inspectors
serializedObject.ApplyModifiedProperties();Tool Selection
| Need | Tool | Reference |
| Custom component UI in Inspector | Custom Inspector | references/custom-inspector.md |
Reusable field decoration ([MinMax], [ReadOnly]) | PropertyDrawer | references/property-drawer.md |
| Standalone tool panel | EditorWindow | references/editor-window.md |
| Always-on spatial visualization | OnDrawGizmos / OnDrawGizmosSelected | Inline below |
| Interactive scene handles (draggable) | Handles API | Inline below |
Gizmos (Quick Reference)
// In a MonoBehaviour — no Editor assembly needed
private void OnDrawGizmosSelected()
{
Gizmos.color = new Color(0f, 1f, 0f, 0.3f);
Gizmos.DrawWireSphere(transform.position, _radius);
}Handles (Quick Reference)
// In an Editor script — requires Editor assembly
[CustomEditor(typeof(PatrolPath))]
public class PatrolPathEditor : Editor
{
private void OnSceneGUI()
{
var path = (PatrolPath)target;
for (int i = 0; i < path.Points.Count; i++)
{
EditorGUI.BeginChangeCheck();
Vector3 newPos = Handles.PositionHandle(path.Points[i], Quaternion.identity);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(path, "Move patrol point");
path.Points[i] = newPos;
EditorUtility.SetDirty(path);
}
}
}
}Editor Script Placement
Assets/_Project/Features/{Feature}/
├── Runtime/
│ ├── {Feature}.asmdef <- Runtime assembly
│ └── MyComponent.cs
└── Editor/
├── {Feature}.Editor.asmdef <- References Runtime assembly
├── MyComponentInspector.cs
└── MyComponentGizmos.csThe Editor asmdef must:
- Reference the Runtime asmdef
- Have
Editorin its Include Platforms (only) - Never be referenced by Runtime assemblies
Build Validation
Add pre-build validators to catch issues before shipping. Place in an Editor assembly.
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
public class PreBuildValidator : IPreprocessBuildWithReport
{
public int callbackOrder => 0;
public void OnPreprocessBuild(BuildReport report)
{
// Run unit tests — fail build if any test fails
// Validate all scenes in Build Settings exist
// Check for missing script references on prefabs
}
}Common validations: unit test pass/fail, scene list completeness, missing component references on prefabs, unresolved addressable entries.
After Setup
- Debug visualization: Use
uw-unity-debuggingGizmos for debug-specific visualizations (raycast paths, trigger volumes, AI sight cones). - Write tests: Use
uw-unity-test-runner— test editor tools in EditMode (validate that SerializedProperty operations produce correct results). - SO inspectors: Use
uw-scriptable-object-archdata containers with custom inspectors for designer-friendly data editing. - UI Toolkit binding: Use
uw-ui-toolkit-binderpatterns if building editor windows with data binding.
Principles
- Undo is non-negotiable: Any editor tool that modifies state without undo support is a bug. Always
Undo.RecordObjectbefore changes. - Designer empathy: Tools exist to make non-programmers productive. A confusing inspector is a failed tool. Ask: is this for designers (intuitive, visual) or developers (can be technical)?
- Build alongside features: Don't wait for a "tooling phase." Build the inspector while the component is being created.
Rules
- Always use
SerializedPropertyfor inspector fields — never direct field access. - Always record Undo before any state modification.
- Always
serializedObject.ApplyModifiedProperties()at the end of inspectorOnInspectorGUI. - Editor scripts live in
Editor/folders with their own.asmdefthat includes onlyEditorplatform. - Never reference Editor assemblies from Runtime assemblies.
[SerializeField] privatefor all Inspector fields — never public fields.- If
ProjectConfig.yaml -> mcp.unity_mcpistrue, callrefresh_unityafter creating files.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

