Decorates a [SerializeReference]
field, adding a type selection dropdown and other optional features.
Argument | Description |
---|---|
type (optional) | Type constraint |
features (optional) | Feature selection flags: - Remove the constrained type label (Type) - Remove "Set to null" from the context menu - Hide the warning icon for null entries |
[SerializeReference, ReferenceDropdown]
public Fruit[] FruitInstance;
ReferenceDropdown
supports property drawers, decorators, and UIToolkit.
- IMGUI support (optional) uses IL injection to make multiple modifications to the editor DLL.
- UIToolkit support uses stateful DecoratorDrawer hacks.
Other implementations often don't support property drawers due to this complexity.
Warning
This package requires Unity 2020.3+
In versions below 2021ReferenceDropdown
may draw incorrectly when used with property drawers that nest property fields.UIToolkit support may have some issues responding to changes, especially involving Undo.
If you have a problem, feel free to create an issue ticket, but pull requests are preferred as this is just a painfully buggy and unsupported area of Unity.
Add |