MinMaxSlider Attribute
Attribute to draw a min max slider
- Parameters:
minRangeThe minimum range of the slidermaxRangeThe maximum range of the slideroptional,
showValuesShow fields of the slider values
Example:
using UnityEngine;
using EditorAttributes;
public class AttributesExample : MonoBehaviour
{
[SerializeField, MinMaxSlider(-10f, 10f)] private Vector2 vector2Field;
[SerializeField, MinMaxSlider(-10f, 10f)] private Vector2Int vector2IntField;
[Space]
[SerializeField, MinMaxSlider(0f, 10f, false)] private Vector2 vector2FieldNoField;
[SerializeField, MinMaxSlider(0f, 10f, false)] private Vector2Int vector2IntFieldNoField;
}
Note
The MinMaxSlider Attribute can only be attached to Vector2 and Vector2Int fields