Description
The Step
property of the RangeAttribute
class specifies the increment value for the range. This property is used to define the step size between values when a slider is used in the inspector. It determines how much the value should increase or decrease when the slider is adjusted.
Usage
Use the Step
property to control the granularity of the value changes within the specified range. This is particularly useful when you want to ensure that the values adhere to a specific increment pattern, such as only allowing even numbers or increments of 0.5.
Example
// Example of using RangeAttribute with Step
[Range(0, 10, Step = 0.5f)]
public float MyValue { get; set; }