HeaderAttribute
Use this PropertyAttribute to add a header above some fields in the Inspector.
Read time 3 minutesLast updated 6 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
- Inherits from: PropertyAttribute
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, Inherited = true, AllowMultiple = true)]public class HeaderAttribute : PropertyAttribute
Remarks
The header is done using a DecoratorDrawer.
Examples
using UnityEngine;public class Example : MonoBehaviour{ [Header("Health Parameters")] public int health = 0; public int maxHealth = 100; [Header("Shield Parameters")] public int shield = 0; public int maxShield = 0;}
Fields
Value | Description |
|---|---|
| header | The header text. |
Constructors
Constructor | Description |
|---|---|
| HeaderAttribute(System.String) | Add a header above some fields in the Inspector. |