Version 2.1.0.0

Odin has a dedicated attribute overview with examples

MinMaxSliderAttribute class

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)]
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.

Inheritance
  • System.Object
  • System.Attribute
  • MinMaxSliderAttribute
Example

The following example shows how MinMaxSlider is used.

public class Player : MonoBehaviour
{
	[MinMaxSlider(4, 5)]
	public Vector2 SpawnRadius;
}

Constructors

MinMaxSliderAttribute(Single, Single, Boolean)
Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max.
public MinMaxSliderAttribute(float minValue, float maxValue, bool showFields = false)
Parameters
System.Single minValue

The min value.

System.Single maxValue

The max value.

System.Boolean showFields

If true number fields will drawn next to the MinMaxSlider.

MinMaxSliderAttribute(Single, String, Boolean)
Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max.
public MinMaxSliderAttribute(float minValue, string maxMember, bool showFields = false)
Parameters
System.Single minValue

The min value.

System.String maxMember

The name of a field, property or method to get the max value from.

System.Boolean showFields

If true number fields will drawn next to the MinMaxSlider.

MinMaxSliderAttribute(String, Boolean)
Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max.
public MinMaxSliderAttribute(string minMaxMember, bool showFields = false)
Parameters
System.String minMaxMember

The name of a Vector2 field, property or method to get the min max values from.

System.Boolean showFields

If true number fields will drawn next to the MinMaxSlider.

MinMaxSliderAttribute(String, Single, Boolean)
Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max.
public MinMaxSliderAttribute(string minMember, float maxValue, bool showFields = false)
Parameters
System.String minMember

The name of a field, property or method to get the min value from.

System.Single maxValue

The max value.

System.Boolean showFields

If true number fields will drawn next to the MinMaxSlider.

MinMaxSliderAttribute(String, String, Boolean)
Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max.
public MinMaxSliderAttribute(string minMember, string maxMember, bool showFields = false)
Parameters
System.String minMember

The name of a field, property or method to get the min value from.

System.String maxMember

The name of a field, property or method to get the max value from.

System.Boolean showFields

If true number fields will drawn next to the MinMaxSlider.

Fields

MaxMember
The name of a field, property or method to get the max value from.
public string MaxMember
MaxValue
The max value for the slider.
public float MaxValue
MinMaxMember
The name of a Vector2 field, property or method to get the min max values from.
public string MinMaxMember
MinMember
The name of a field, property or method to get the min value from.
public string MinMember
MinValue
The min value for the slider.
public float MinValue
ShowFields
Draw float fields for min and max value.
public bool ShowFields

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.