I am making my own node editor based on a simple framework. One thing I have not been able to figure out is how to get reflection working properly.
What would be the (generalized) way of going about typing a string into an (node) editor window and then pulling data from some class at runtime?
For example. If in the editor I type $health
, I want to get the Player.Health.currentValue
at runtime. Do I need to store the player class somewhere? How do I get to the correct object of the class?
I’ve been looking around tutorials and manuals, but only find general explanations of reflections, which I understand. What I dont know is how to deal with writing something in the editor and then during runtime access the relevant variable.
Maybe using statics? The idea is to stay away from that as well as from singletons.