PropertyRangeAttribute

PropertyRange attribute creates a slider control to set the value of a property to between the specified range.

This is equivalent to Unity's Range attribute, but this attribute can be applied to both fields and property.

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

Requirements

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

See Also

Fields

Return Type Definition Description
double Max The maximum value.
string MaxMember The name of a field, property or method to get the max value from.
double Min The minimum value.
string MinMember The name of a field, property or method to get the min value from.

Constructors

Definition Description
PropertyRangeAttribute(double, double) Creates a slider control to set the value of the property to between the specified range..
PropertyRangeAttribute(double, string) Creates a slider control to set the value of the property to between the specified range..
PropertyRangeAttribute(string, double) Creates a slider control to set the value of the property to between the specified range..
PropertyRangeAttribute(string, string) Creates a slider control to set the value of the property to between the specified range..

Example

The following example demonstrates how PropertyRange is used.