Agent Skills
› Besty0728/Unity-Skills
› unity-inspector
unity-inspector
GitHub为Unity Inspector的组件设计与序列化字段组织提供最佳实践建议,涵盖SerializeField用法、属性装饰、校验逻辑及自定义显示优化,旨在提升脚本的可读性与编辑体验。
Trigger Scenarios
用户询问如何在Unity中设计Inspector界面或布局字段
用户需要优化序列化字段的显示效果或添加提示/分组
用户希望改善编辑器中的组件配置与调试体验
Install
npx skills add Besty0728/Unity-Skills --skill unity-inspector -g -y
SKILL.md
Frontmatter
{
"name": "unity-inspector",
"description": "Advises on Unity Inspector authoring UX — SerializeField usage, Tooltip\/Header organization, validation, and custom Inspector display. Use when designing how a component appears in the Inspector, organizing serialized fields, adding tooltips\/headers, or improving authoring UX, even if the user just says \"Inspector怎么设计\" or \"字段怎么显示\". 为 Unity Inspector 编写体验提供建议(SerializeField 用法、Tooltip\/Header 组织、校验、自定义 Inspector 显示);当用户要设计组件在 Inspector 的呈现、组织序列化字段、添加提示\/分组或改善编辑体验时使用。"
}
Unity Inspector Design
Use this skill when scripts need to be easier to author, configure, and review in the Inspector.
Guardrails
Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).
- Prefer
[SerializeField] privateover unnecessary public fields. - Do not over-decorate with attributes when simple naming suffices.
Default Rules
- Use
[Header],[Tooltip],[Space],[Range],[Min],[TextArea]when they clarify authoring intent. - Use
[RequireComponent]for mandatory sibling dependencies. - Use
[CreateAssetMenu]for config/data assets that designers should create directly. - Use
OnValidateonly for lightweight editor-time validation and normalization. - Use
SerializeReferenceonly when polymorphic serialized data is genuinely needed.
Inspector Quality Checklist
- Are defaults safe?
- Are required references obvious?
- Are fields grouped by responsibility?
- Are tuning values constrained?
- Are debug-only fields separated from authoring fields?
- Will another person understand this script from the Inspector alone?
Output Format
- Field exposure strategy
- Recommended attributes
- Validation rules
- Authoring UX improvements
- Over-design to avoid
Version History
- ec9f870 Current 2026-07-05 14:40


