alelievr / NodeGraphProcessor

Node graph editor framework focused on data processing using Unity UIElements and C# 4.6
https://github.com/alelievr/NodeGraphProcessor/projects/2
MIT License
2.34k stars 387 forks source link

Support for [Range] attribute, or ability to easily support custom drawing attributes #160

Closed arycama closed 3 years ago

arycama commented 3 years ago

It seems that to support built in attributes like this, I would need to override and re-implement most of the drawing logic in BaseNodeView.

It would be great if there is support for builtin attributes such as Range, Min, Max, etc.

Alternatively, if there's an easy way to make a custom attribute which allows us to override how it is drawn, that would be very useful.

alelievr commented 3 years ago

Hello, this is the same issue as #87. So same state: I'm making progress, but not there yet (still have the reload graph issue when a property is modified from a SerializedField inside a node)

alelievr commented 3 years ago

Support of all builtin unity attributes have been added with the latest master, they will be available in the next published package version (1.3.0)

Note that to use the range attribute, you'll need a fairly large node as the default inspector only shows the slider on fields with a certain min width: image

Otherwise, you can remove the label of the field using [InspectorName("")] on the field like so: image