Graphview serialized variable reference


Right now im using an ObjectField() for this demonstration but I would like to know how I can reference an objects script then get a reference to the variable in runtime, I know that there is ExposedReference but I dont have a clue on how to make that display on the graph view. Im currently saving my graph in a scriptable object if that context might alter the solution

(Im on 2022.3)

I mean there’s always reflection, but it’s just going to end up being a crutch in the long run.

Another way to do this is just generic value scriptable objects, like a FloatValue, IntValue, etc scriptable objects, like in that old Unite video.

Or you can use [SerializeReference] to simply code different ways of plugging in values.

All the above have various pros and cons, though no reason why all of them can’t be used together in some form.

I saw the [SerializeReference] tag and I would like to use it but I have no idea of how to implement it to the graph view as a field

It just needs a custom property drawer to draw a dropdown, and then also draw the serialized property for the value itself after.

I wrote a basic example here: abstract SkillList that can be edited in Inspector - #15 by spiney199