unity-inspector

Advises on Unity Inspector field exposure, attributes, and validation for component authoring.

Updated Jun 21, 2026
One-click install
npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-inspector-du-qwq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-inspector
Source: https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications/tree/main/.agents/skills/unity-skills/skills/inspector
Command: npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-inspector-du-qwq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Unity components often expose fields in the Inspector in confusing or unsafe ways, making scripts hard for designers and teammates to configure. This Skill provides concrete guidance on organizing serialized fields, applying the right attributes, and adding lightweight validation so components are self-explanatory in the editor. ## Core Features & Use Cases - Field Exposure Strategy: Recommends [SerializeField] private over public fields and decides when SerializeReference is genuinely needed. - Attribute Organization: Applies [Header], [Tooltip], [Space], [Range], [Min], and [TextArea] to group and constrain tuning values. - Validation & Safety: Uses OnValidate for lightweight editor-time checks, [RequireComponent] for dependencies, and [CreateAssetMenu] for designer-facing data assets. - Use Case: When writing a new MonoBehaviour with many tunable parameters, ask for an Inspector review to get grouped fields, safe defaults, and clear tooltips before handing it to a designer. ## Quick Start Review this MonoBehaviour and suggest how to organize its serialized fields in the Unity Inspector with appropriate attributes and validation.

Frequently Asked Questions about unity-inspector

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

FAQPage Schema
How do I organize serialized fields in the Unity Inspector?

Group fields by responsibility using [Header] and [Space], add [Tooltip] for non-obvious values, and constrain tuning numbers with [Range] or [Min]. Prefer [SerializeField] private over public fields to keep the API surface clean.

When should I use SerializeField instead of public fields in Unity?

Use [SerializeField] private by default so fields appear in the Inspector without becoming part of the class's public API. Reserve public fields only when other scripts genuinely need direct access.

What is OnValidate used for in Unity scripts?

OnValidate runs in the editor when Inspector values change, making it suitable for lightweight validation and normalization like clamping values or auto-assigning references. Avoid heavy logic or scene modifications inside it.

When should I use SerializeReference in Unity?

Use SerializeReference only when you genuinely need polymorphic serialized data, such as a list of mixed subclass types. For simple data, plain serializable classes or ScriptableObjects are simpler and safer.

Should I use CreateAssetMenu for configuration data in Unity?

Yes, add [CreateAssetMenu] to ScriptableObject classes that represent config or data assets designers should create directly from the Assets menu. This keeps tunable data separate from scene components.