MinValue / MaxValueLimit for number field. Support single number like int, float, and combo numbers like vector, color. Supported types are:
number types
int,uint,sbyte,byte,short,ushort,long,ulongfloat,doubledecimal
combo types
Vector2,Vector2Int,Vector3,Vector3Int,Vector4QuaternionColor,Color32Rect,RectIntBounds,BoundsInt- Custom type which has
x,y,z,wproperties, and they are all number types
Parameters
It accepts 1~6 parameters. For each parameter:
- If it's a number type, use that value
- If it's a string, use as callback. The callback must return either a number type, or
nullfor no limit - If it's
null, then no limit for this number
For each parameter:
object position0=null: limit for first number. If it's number types, limit this number field. Otherwise, limit for:xvalue for vector types,Quaternion, and rect types, and custom typervalue for color typesxvalue forBounds.centerandBoundsInt.position
object position1=null: limit for:yvalue for vector types,Quaternion, and rect types, and custom typegvalue for color typesyvalue forBounds.centerandBoundsInt.position
object position2=null: limit for:zvalue for vector types,Quaternion, and custom typewidthfor rect typesbvalue for color typeszvalue forBounds.centerandBoundsInt.position
object position3=null: limit for:wvalue for vector types,Quaternion, and custom typeheightfor rect typesavalue for color typesxvalue forBounds.extentsandBoundsInt.size
object position4=null: limit for:yvalue forBounds.extentsandBoundsInt.size
object position5=null: limit for:zvalue forBounds.extentsandBoundsInt.size
Allow Multiple: Yes
using SaintsField; public int upLimit; [MinValue(0), MaxValue(nameof(upLimit))] public int min0Max; [MinValue(nameof(upLimit)), MaxValue(10)] public float fMinMax10;
Example:
// Color, but requires alpha=1 (no transparent) using SaintsField; [MinValue(position3: 255)] [MaxValue(position3: 255)] public Color32 color32NoAlpha; [MinValue(position3: 1)] [MaxValue(position3: 1)] public Color color32Alpha;
Example with callback field walk:
[MinMaxSlider(10, 20)] public Vector2Int heightRange; [MinValue(position3: nameof(heightRange) + ".x")] [MaxValue(position3: nameof(heightRange) + ".y")] public Rect rectHeightLimited;