Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Any plans for (officialy) adding more attributes for formatting inspectors on custom classes

Discussion in 'UI Toolkit' started by venediklee, Aug 26, 2022.

  1. venediklee

    venediklee

    Joined:
    Jul 24, 2017
    Posts:
    210
    Hi, while I love using the many editor attributes in my custom classes like
    Code (CSharp):
    1. [Space]
    2. [Header()]
    3. [Tooltip()]
    4. [Min()]
    5. [ContextMenu()]
    6. [HideInInspector]
    7. [Range()]
    to make the class/field more user friendly, there are still missing features. One of the best examples of this is having a button to execute a method within that class instead of a ContextMenu option(which is "hidden" by default, so less user friendly). While Unity implements some form of a button to do this in some of its default classes, there is no such attribute shipped by Unity by default.

    I am using an open source library for more attributes, called NaughtyAttributes but it is not perfect and I feel like Unity should have had these and perhaps more for a long time.

    Thank you for your time :)
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,533
    The ubiquitous [(Inspector)ReadOnly(Field)] ...
     
  3. martinpa_unity

    martinpa_unity

    Unity Technologies

    Joined:
    Oct 18, 2017
    Posts:
    471
    Hi!
    At the moment, the priority is mainly about reaching parity with what IMGUI provided and making sure all of the existing attributes/decorators are supported in UI Toolkit.

    I would suggest to make an official request for adding more attribute here.

    As far as I'm aware, we don't have plans for now to add new ones, but not something we're against doing in the future.
     
  4. venediklee

    venediklee

    Joined:
    Jul 24, 2017
    Posts:
    210
    Thank you for the suggestion, I just submitted the request ;)
     
    martinpa_unity likes this.