I’m trying to write a script for dialogue, and I want to it be able to check against public variables/functions, akin to how Unity Animations can find any public functions on an object. I was just curious if there’s any known way to achieve this? Or whether it would be shorter to manually code for each possibility.
If your system is not terribly complex, maybe a text box with a few different strings shown, it might be best to manually code it all.
If your system is complex: different behaviors for texts, restrictions or other rules that apply. Manually coding that all doesn’t sound like a very good design decision. You should take a look into polymorphism and the strategy pattern.
If you still feel a need to access individual functions from classes, you can use reflection to gather all kinds of information about classes, including fields and functions. And even then, you need to somehow (Attributes)apply context information to these fields and functions to allow the computer to choose the correct one. After all, to the computer, it’s all 1s and 0s. Reflection is slow and might not work on all platforms.