How ToolboxDrawers work
masterToolboxDrawers are categorized into 5 sub-types to handle different Inspector customization needs. Choosing the right type depends on whether you want to decorate, validate, or completely replace the rendering of a property.
Drawer Sub-types
- ToolboxDecoratorDrawers: Used to create UI elements (icons, labels, controls) that appear before or after a serialized property. You can use multiple decorators on a single property.
- ToolboxConditionDrawers: Used to validate a property's state. They determine if a property should be
Disabledor hidden. Use only one per property. - ToolboxSelfPropertyDrawers: Used to customize the visual look of a specific property field. Use only one per property.
- ToolboxListPropertyDrawers: Used to customize the appearance of list/array properties. Use only one per property.
- ToolboxTargetTypeDrawers: Used to specify a custom look for all properties of a specific type (e.g., all
intfields) regardless of attributes.
Implementation Workflow
To create a new drawer, follow these steps:
- Decide which drawer sub-type fits your requirement.
- Implement a dedicated
ToolboxAttributeclass (if the drawer is attribute-based). - Implement the corresponding
ToolboxDrawerclass. - Assign the newly created drawer in the Toolbox Settings file.
- Apply the attribute to your target field in your scripts.