Version: 2022.3

RangeAttributeConstructor

切换到手册
public RangeAttribute (float min, float max);

参数

min 允许的最小值。
max 允许的最大值。

描述

用于使脚本中的 float 或 int 变量受限于特定范围的属性。

使用此属性时,float 或 int 会在 Inspector 中显示为滑动条而不是默认数字字段。