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
[ObsoleteAttribute("Drawers are now registered by default without applying this attribute - use [DontRegisterDrawer] instead on drawers that you don't want to be globally registered.", False)]
public class OdinDrawerAttribute : Attribute


Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector

See Also


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


// Specify that this drawer must be included in the inspector; without this, it will not be drawn
ublic 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);