OdinDrawer

Base class for all Odin drawers. In order to create your own custom drawers you need to derive from one of the following drawers:

<list>(4478,8)

Remember to provide your custom drawer with an OdinDrawerAttribute in order for it to be located by the DrawerLocator.

Drawers require a PropertyTree context, and are instantiated automatically by the DrawerLocator.

Odin supports the use of GUILayout and takes care of undo for you. It also takes care of multi-selection in many simple cases. Checkout the manual for more information.

namespace Sirenix.OdinInspector.Editor
{
public abstract class OdinDrawer
}

Requirements

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

See Also

Properties

Return Type Definition Description
bool AutoSetGUIEnabled If true, not-editable properties will not have its GUI being disabled as otherwise would be the case. This is useful if you want some GUI to be enabled regardless of whether a property is read-only or not. This value is true when an AllowGUIEnabledForReadonlyAttribute is defined on the drawer class itself.
OdinDrawerAttribute OdinDrawerAttribute Gets the OdinDrawerAttribute defined on the class. This returns null, if no OdinDrawerAttribute is defined.

Methods

Return Type Definition Description
bool CallNextDrawer(InspectorProperty, GUIContent)

Calls the next drawer in the drawer chain.

Odin supports multiple drawers being used to draw any given property. This method calls the next drawer in the drawer chain provided by the DrawerLocator. The order of the drawer chain is defined using the DrawerPriorityAttribute.

bool CallNextDrawer(IPropertyValueEntry, GUIContent)

Calls the next drawer in the drawer chain.

In Odin, multiple drawers are used to draw any given property. This method calls the next drawer in the drawer chain provided by the DrawerLocator. The order of the drawer chain is defined using the DrawerPriorityAttribute.

bool CanDrawTypeFilter(Type)

Override this method in order to define custom type constraints to specify whether or not a type should be drawn by the drawer.

Note that Odin's DrawerLocator has full support for generic class constraints, so most often you can get away with not overriding CanDrawTypeFilter.

void DrawProperty(InspectorProperty) Draws the property using the default label found in InspectorPropertyThis method also disables the GUI if the property is read-only and AutoSetGUIEnabled is false.
void DrawProperty(InspectorProperty, GUIContent) Draws the property with a custom label. This method also disables the GUI if the property is read-only and AutoSetGUIEnabled is false.
void DrawPropertyImplementation(InspectorProperty, GUIContent) Draws the actual property. This method is called by this.DrawProperty(...)