Warning This package has been replaced with SerializeReference Dropdown.
OLD README
Attributes and Property Decorators for Unity that have access to the SerializedProperty used to draw the field.
Thanks to Marcel Wiessler and this article from Sebastian Schöner for the inspiration behind this implementation.
In versions below 2021, TypeProvider may draw incorrectly when combined with property drawers that nest the SerializedProperty.
[TypeProvider]
[TypeProvider(typeof(Example))]
Decorates a[SerializeReference]
field, providing instances of a type that can easily be added via a dropdown.
TypeProvider
supports custom editors, property drawers, and decorators.
It does this by injecting multiple modifications into the editor DLL. Other implementations may not achieve the same flexibility.
An abstract DecoratorDrawer implementation that has access to the SerializedProperty used to draw the field.
These decorators still do not draw on individual collection elements. If you have use case similar to TypeProvider
that requires collection elements, please let me know.
Add from OpenUPM | via scoped registry, recommended
This package is available on OpenUPM: https://openupm.com/packages/com.vertx.decorators
To add it the package to your project:
- open
Edit/Project Settings/Package Manager
- add a new Scoped Registry:
Name: OpenUPM URL: https://package.openupm.com/ Scope(s): com.vertx com.needle
- click Save
- open Package Manager
- click +
- select Add from Git URL
- paste
com.vertx.decorators
- click Add
Add from GitHub | not recommended, no updates through UPM
You can also add it directly from GitHub on Unity 2019.4+. Note that you won't be able to receive updates through Package Manager this way, you'll have to update manually.
- open Package Manager
- click +
- select Add from Git URL
- paste
https://github.com/vertxxyz/Vertx.Decorators.git
- click Add
or - Edit your
manifest.json
file to contain"com.vertx.decorators": "https://github.com/vertxxyz/Vertx.Decorators.git"
,
To update the package with new changes, remove the lock from the packages-lock.json
file.