Min Value
[MinValue]
The attribute checks that the number field is greather than/equal to specific value.
Support Types
Type |
---|
Integer |
Float |
Double |
Parameters
Parameter Name | Description |
---|---|
Value |
Min possible value for number field. |
PropertyName |
Min possible value represented in property for number field. |
Tolerance |
TODO! |
Examples
[MinValue("minHealth")]
public int health;
[MinValue(0)]
public int minHealth;
[MinValue("walkSpeed", 1)]
public float runSpeed;
[MinValue(1)]
public float walkSpeed;
[MinValue(10)]
public double someValue;
[MinValue("someValue", 0.1f)]
public double someValue2;
Note
Make sure that you have added ApexInspector namespace in your script, to get access to all attributes.
using ApexInspector;
Demo
using ApexInspector;
using UnityEngine;
public class ExampleComponent : MonoBehaviour
{
[MinValue(1)]
public int speed;
}
Live demo