dbrizov / NaughtyAttributes

Attribute Extensions for Unity
MIT License
4.53k stars 464 forks source link

Added an optional format string for `[Dropdown]` #330

Open nitz opened 2 years ago

nitz commented 2 years ago

Didn't realize that renaming a branch would auto-close the previous PR. 😅

A continuation of #286 after feedback from @rhys-vdw;

Instead of allowing the user to provide individual prefixes or suffixes to the way values are displayed by the [Dropdown] attribute, instead this allows them to provide a standard format string that can manipulate the values as they see fit.

This allows for more custom display for values, with minimal in-class additions by the end user:

E.g.: image

Results in:

image

and

image