Skip to main content

Class MinMaxSliderAttribute

Attribute for displaying a Min-Max slider in the Unity Inspector for Vector2 or Vector2Int fields.

public class MinMaxSliderAttribute : PropertyAttribute

Inheritance​

Remarks​

A Min-Max slider is a user interface control that allows editing of two related values — a minimum and a maximum — within a specified numeric range.

When applied to a Vector2 or Vector2Int field, the x component represents the minimum value, and the y component represents the maximum value. The slider constrains the input values between the specified lower and upper bounds provided via this attribute.

Constructors​

MinMaxSliderAttribute(float, float)​

Creates a new MinMaxSliderAttribute with the given min and max bounds.

public MinMaxSliderAttribute(float min, float max)

Parameters​

NameTypeDescription
minfloatMinimum slider value.
maxfloatMaximum slider value.

Fields​

max​

The maximum allowed value on the slider.

public float max

Field Value​

float

min​

The minimum allowed value on the slider.

public float min

Field Value​

float