WrapAttribute

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.

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

Requirements

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector
Version: 1.0.4.1

See Also

  • !:AngleWrapAttribute

Constructors

Definition Description
WrapAttribute(double, double) Wraps the value of the property round when the values goes out of range.

Properties

Return Type Definition Description
double Max Heighest value for the property.
double Min Lowest value for the property.

Example

The following example show how Wrap is used on a property.

public class MyComponent : MonoBehaviour
{
	[Wrap(-100, 100)]
	public float MyFloat;
}