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 class PropertyOrderAttribute : Attribute, _Attribute
PropertyOrder is used on any property, and allows for ordering of properties.
Use this to define in which order your properties are shown.
Lower order values will be drawn before higher values.
There is unfortunately no way of ensuring that properties are in the same order, as they appear in your class. PropertyOrder overcomes this.
The following example shows how PropertyOrder is used to order properties in the inspector.
public class MyComponent : MonoBehaviour
{
[PropertyOrder(1)]
public int MySecondProperty;
[PropertyOrder(-1)]
public int MyFirstProperty;
}
public PropertyOrderAttribute()
public PropertyOrderAttribute(float order)
System.Single | order | The order for the property. |
public float Order