Decorators/Custom Attributes

Hello again!
Simple question, do we have an equivalent to build-in Unity attributes like [range(0,100)] that can be used from typescript?
I know that you can make a custom inspector from the Unity side, but it would be nice to have the basic ones generated from the ts side.

Original Post on Discord

by user 368204675922657280

You mean generate that attribute from a typescript comment ?

Or do you mean preventing setting values exceeding this range in typescript?

To generate the attribute. Like, we already have @serializable. I know that it doesn’t directly translate to [serializeField] or system.serializable but I find the concept to be really intuitive :classyblobthink:

by user 368204675922657280

I’m also referring to [Header("ble")] and [Tooltip("ble again")] and [space].

by user 368204675922657280

Tooltip is supported :slightly_smiling_face: https://www.npmjs.com/package/@needle-tools/needle-component-compiler

Great! Thanks for the link.
I hope support for range, header aaaaaand maybe space is also added. :smile:

by user 368204675922657280