Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.
/ Vertx.Decorators Public archive

Attributes and Property Decorators for Unity that have access to the SerializedProperty used to draw the field.

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

vertxxyz/Vertx.Decorators

Repository files navigation

Vertx.Decorators

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.

⚠️ This package requires 2020.3+ ⚠️
In versions below 2021, TypeProvider may draw incorrectly when combined with property drawers that nest the SerializedProperty.

Attributes

Type Provider

  • [TypeProvider]
  • [TypeProvider(typeof(Example))]
    Decorates a [SerializeReference] field, providing instances of a type that can easily be added via a dropdown.

Type Provider Example

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.

DecoratorDrawerWithProperty

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.

Installation

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",

⚠️ decorators has a dependency on Editor Patching and Vertx.Utilities so ensure they are referenced into your project to use this package successfully. ⚠️

To update the package with new changes, remove the lock from the packages-lock.json file.

About

Attributes and Property Decorators for Unity that have access to the SerializedProperty used to draw the field.

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Languages