using System;
namespace AdvancedInspector
{
///
/// Similar to Unity's "Range" attribute but for the Advanced Inspector.
/// However, Unity's version is flagged to be "Field Only", while this one can be placed on Properties.
///
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public class RangeValueAttribute : Attribute, IListAttribute
{
private float min;
///
/// Min value, the current value cannot go below that.
///
public float Min
{
get { return min; }
set { min = value; }
}
private float max;
///
/// Max value, the current value cannot go above that.
///
public float Max
{
get { return max; }
set { max = value; }
}
public RangeValueAttribute(float min, float max)
{
this.min = min;
this.max = max;
}
}
}