Feature Request: Ability to add Attributes to fields/properties/methods in base classes

Issue #306 resolved
Former user created an issue

It would be really nice to have a way to add Attributes to base class fields, properties and/or methods, especially since we often don't have direct access to editing the base classes (such as SerializedMonoBehaviour or even MonoBehaviour).

Maybe something similar to how System.Componentment.DataAnnotations.MetadataType works?

Comments (2)

  1. Bjarke Elias

    Agreed 😀

    In fact this is already implemented in 1.1

    Copy paste:

    In Odin Inspector patch 1.1, we've completely rewritten how the property tree works internally. Properties are now lazily evaluated, which means that Odin doesn't care how much data you throw at it, it will only do processing on the properties you're looking at, which is currently not the case. This will vastly increase editor performance.

    It will also introduce attribute and property resolvers and locators. Much more on that later, but this means that attributes and properties can come from anywhere. This will open up a world of new possibilities! You'll be able to add attributes to members you don't own the code for, you would be able to put all attributes on the types and have them be applied globally for all members of that type, ShowInInspector will work on static members as well. We could even at some point, go as far as to create an editor to make editors, meaning you wouldn't even have to put attributes on your members, you could just right-click a property in the inspector, and customize it. Adjust the range slider, drag and drop them around to change the order etc...

    You can sign up for beta testing by sending us a mail with your Odin invoice Id included from our contact form.

  2. Log in to comment