Description
The Max
property of the RangeAttribute
class specifies the maximum value of a range for a float or integer property. This attribute is typically used in the context of a user interface, such as an inspector, to define the upper limit of a slider control.
Usage
To use the Max
property, apply the RangeAttribute
to a float or integer property in your class. Set the Max
property to define the maximum allowable value for the range. This is particularly useful for creating intuitive UI elements like sliders, where you want to restrict the input to a specific range.
Example
// Example of using RangeAttribute with Max property
public class MyComponent : Component
{
[Range(Min = 0.0f, Max = 100.0f, Step = 1.0f, Slider = true)]
public float MyValue { get; set; }
}