HeaderAttribute

class in UnityEngine

/

继承自:PropertyAttribute

切换到手册

描述

使用该 PropertyAttribute 在 Inspector 中的某些字段上方添加标题。

标题使用 DecoratorDrawer 完成。

using UnityEngine;

public class Example : MonoBehaviour { [Header("Health Settings")] public int health = 0; public int maxHealth = 100;

[Header("Shield Settings")] public int shield = 0; public int maxShield = 0; }

变量

header标题文本。

构造函数

HeaderAttribute在 Inspector 中的某些字段上方添加标题。

继承的成员

变量

order可选字段,用于指定多个 DecorationDrawer 应采用的绘制顺序。