Is there a way to get all current SharedVariable types ina MonoBehaviour inspector?

RedStage

New member
I'm making a component which can, for example toggle a bool variable in a BehaviourTree. Is there any way to get all current SharedVariable types in an inspector, for example in a dropdown, similar to the variable type selection inside the BehaviourTree (pictured)?

1629290590783.png
 
That drop-down is populated by using reflection to search for all types derived from the SharedVariable Type. You should be able to do something similar for your own component. If you want to get all of the variables for a specific tree you can do that by looking in the variables field of the BehaviorSource within the BehaviorTree component
 
Top