Utility class for locating and sorting property drawers for the inspector.

See Odin manual section 'Drawers in Depth' for details on how the DrawerLocator determines which drawers to use.

namespace Sirenix.OdinInspector.Editor
public static class DrawerLocator


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

Static Fields

Return Type Definition Description
HashSet<string> ExcludeUnityDrawers Odin has its own implementations for these attribute drawers; never use Unity's.

Static Methods

Return Type Definition Description
IEnumerable<DrawerInfo> GetAllDrawerInfos() Get all drawer infos.
IEnumerable<DrawerInfo> GetAttributeDrawerInfos() Get all drawer infos for attribute drawers.
OdinDrawer[] GetAttributeDrawers(Type, Type, bool) Gets all attribute drawers for a given attribute and value type.
DrawerPriority GetDrawerPriority(Type) Gets the priority of a given drawer type.
OdinDrawer[] GetDrawersForInstanceMethod(MemberInfo) Gets all method drawers for a given declaring type.
OdinDrawer[] GetDrawersForMemberInfo(MemberInfo, Type, bool) Get all primary value drawers for a given member info with a given contained value type.
OdinDrawer[] GetDrawersForProperty(InspectorProperty) Gets all drawers for a given property.
IEnumerable<DrawerInfo> GetGroupDrawerInfos() Get all drawer infos for group drawers.
OdinDrawer GetNextDrawer(OdinDrawer, InspectorProperty) Gets the next drawer for a given drawer and a given property, if any exists.
IEnumerable<DrawerInfo> GetPropertyDrawerInfos() Get all drawer infos for property value drawers.
OdinDrawer[] GetPropertyGroupDrawers(Type) Gets all primary drawers for a given property group attribute type.
OdinDrawer[] GetValueDrawers(Type) Gets all drawers for a given value type.
void RegisterCustomDrawerLocator(CustomDrawerLocator)

Registers a custom drawer locator. Note that since drawers are, for now, globally and statically cached, if this is registered late then it will not factor into drawer selection.

It is advisable to register custom drawer locators using [ !:InitializeOnLoad].