Namespace: | Sirenix.OdinInspector |
Assembly: | Sirenix.OdinInspector.Attributes |
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All, AllowMultiple = false, Inherited = true)]
[Conditional("UNITY_EDITOR")]
public sealed class MinMaxSliderAttribute : Attribute, _Attribute
Draw a special slider the user can use to specify a range between a min and a max value.
Uses a Vector2 where x is min and y is max.
The following example shows how MinMaxSlider is used.
public class Player : MonoBehaviour
{
[MinMaxSlider(4, 5)]
public Vector2 SpawnRadius;
}
public MinMaxSliderAttribute(float minValue, float maxValue, bool showFields = false)
System.Single | minValue | The min value. |
System.Single | maxValue | The max value. |
System.Boolean | showFields | If |
public MinMaxSliderAttribute(float minValue, string maxValueGetter, bool showFields = false)
System.Single | minValue | The min value. |
System.String | maxValueGetter | A resolved string that should evaluate to a float value, which is used as the max bounds. |
System.Boolean | showFields | If |
public MinMaxSliderAttribute(string minMaxValueGetter, bool showFields = false)
System.String | minMaxValueGetter | A resolved string that should evaluate to a Vector2 value, which is used as the min/max bounds. If this is non-null, it overrides the behaviour of the MinValue, MinValueGetter, MaxValue and MaxValueGetter members. |
System.Boolean | showFields | If |
public MinMaxSliderAttribute(string minValueGetter, float maxValue, bool showFields = false)
System.String | minValueGetter | A resolved string that should evaluate to a float value, which is used as the min bounds. |
System.Single | maxValue | The max value. |
System.Boolean | showFields | If |
public MinMaxSliderAttribute(string minValueGetter, string maxValueGetter, bool showFields = false)
System.String | minValueGetter | A resolved string that should evaluate to a float value, which is used as the min bounds. |
System.String | maxValueGetter | A resolved string that should evaluate to a float value, which is used as the max bounds. |
System.Boolean | showFields | If |
public float MaxValue
public string MaxValueGetter
public string MinMaxValueGetter
public float MinValue
public string MinValueGetter
public bool ShowFields