unity-inspector

Advise Unity Inspector field exposure, attributes, and validation for C# scripts.

Updated Apr 15, 2026
One-click install
npx skills add https://github.com/Yuan-Zzzz/FrogRE --skill unity-inspector-yuan-zzzz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-inspector
Source: https://github.com/Yuan-Zzzz/FrogRE/tree/main/.codex/skills/unity-skills/skills/inspector
Command: npx skills add https://github.com/Yuan-Zzzz/FrogRE --skill unity-inspector-yuan-zzzz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unity scripts often expose fields in the Inspector in ways that are confusing, unsafe, or difficult for other team members to author and tune; this Skill provides practical advice to improve field exposure, attribute usage, validation, and grouping so that Inspectors are self-explanatory and robust.

Core Features & Use Cases

  • Field exposure strategy: Recommend when to use private serialized fields, public properties, or hidden debug fields to balance encapsulation and authoring convenience.
  • Attribute recommendations: Suggest Header, Tooltip, Space, Range, Min, TextArea, SerializeReference, RequireComponent, and CreateAssetMenu usage to clarify intent and constrain tuning.
  • Validation & UX: Propose lightweight OnValidate checks, safe defaults, and grouping patterns to prevent runtime errors and make scripts understandable from the Inspector alone.
  • Use case: Improve a MonoBehaviour or ScriptableObject so designers can tune gameplay values safely and spot missing references without reading source code.

Quick Start

Improve the Inspector for the provided Unity C# script by recommending which fields should be exposed, what attributes to add, and any OnValidate rules to ensure safe defaults and clearer authoring.

Frequently Asked Questions about unity-inspector

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

FAQPage Schema
How do I make Unity Inspector fields clearer for designers to tune?

Use SerializeReference for polymorphic data structures in Unity Inspector, allowing flexible composition of derived types without fixed array allocations. This approach supports modular ScriptableObject and MonoBehaviour design when exposing complex, interchangeable serialized settings.

When should I use private serialized fields instead of public fields in Unity?

Use private serialized fields instead of public fields in Unity to expose values for authoring while maintaining encapsulation. This strategy prevents external scripts from modifying gameplay tuning values directly, ensuring safe defaults and controlled access during runtime.

How do I add validation checks for missing references in Unity scripts?

Add validation checks for missing references by implementing OnValidate in your MonoBehaviour or ScriptableObject. This method executes in the editor, allowing you to detection null references, enforce safe defaults, and log warnings when serialized settings are incomplete.

Does this approach work for both MonoBehaviour and ScriptableObject scenarios?

Yes, this approach works for both MonoBehaviour and ScriptableObject scenarios in Unity. The strategies for field exposure, attribute annotations, and OnValidate validation apply equally to both for creating clear serialized settings and safe default values.

What is the best way to group related settings in a Unity Inspector?

The best way to group related settings in a Unity Inspector is using Header and Space attributes. These visually separate serialized fields into logical sections, improving authoring UX by making the component configuration self-explanatory and organized.

Why use RequireComponent and CreateAssetMenu when authoring Unity scripts?

Use RequireComponent to enforce necessary dependencies on GameObjects, preventing missing reference errors at runtime. Use CreateAssetMenu to define clear authoring paths for ScriptableObject instances, ensuring safe defaults and organized asset creation during tuning.