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 WrapAttribute : Attribute, _Attribute
Wrap is used on most primitive property, and allows for wrapping the value when it goes out of the defined range.
Use this when you want a value that goes around in circle, like for example an angle.
Currently unsigned primitives are not supported.
The following example show how Wrap is used on a property.
public class MyComponent : MonoBehaviour
{
[Wrap(-100, 100)]
public float MyFloat;
}
public WrapAttribute(double min, double max)
System.Double | min | The lowest value for the property. |
System.Double | max | The highest value for the property. |
public double Max
public double Min