MinMaxSliderAttribute

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.

namespace Sirenix.OdinInspector
{
[AttributeUsageAttribute((AttributeTargets)32767, AllowMultiple = False, Inherited = True)]
public sealed class MinMaxSliderAttribute : Attribute
}

Requirements

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector
Version: 2.0.0.0

Fields

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

Constructors

Definition Description
MinMaxSliderAttribute(float, float, bool) Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max.
MinMaxSliderAttribute(float, string, bool) Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max.
MinMaxSliderAttribute(string, bool) Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max.
MinMaxSliderAttribute(string, float, bool) Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max.
MinMaxSliderAttribute(string, string, bool) Draws a min-max slider in the inspector. X will be set to min, and Y will be set to max.

Example

The following example shows how MinMaxSlider is used.

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