OdinDrawerAttribute

When creating custom property drawers with OdinValueDrawer<T> or OdinAttributeDrawer<TAttribute, TValue> etc, an OdinDrawerAttribute must be defined on the custom drawer class itself in order to specify that the drawer is meant to be included in the inspector.

If no OdinDrawerAttribute is defined, the DrawerLocator will ignore your drawer.

namespace Sirenix.OdinInspector.Editor
{
[AttributeUsageAttribute((AttributeTargets)4)]
public class OdinDrawerAttribute : Attribute
}

Requirements

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector
Version: 1.0.6.1

See Also

Constructors

Definition Description
OdinDrawerAttribute() Initializes a new instance of the OdinDrawerAttribute class.

Example

[OdinDrawer] // Specify that this drawer must be included in the inspector; without this, it will not be drawn
public class MyCustomTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomBaseType
{
    protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label)
    {
        T value = entry.SmartValue;
        // Draw property here.

        // Optionally, call the next drawer in line.
        this.CallNextDrawer(entry, label);
    }
}