Question by
unity_Set8eiui9pSXSA · May 12 at 10:36 PM ·
variablesreferenceinputfieldanother script
get all variables of a type from an object's components
I have a Behavior tree and i want my Condition Node to get all variables of a type(bools for example) of all(or a certain) component attached to the object holding the tree. and then show it in the inspector as an enum or whatever.
how would i go to achieve this? i thought about using a string like "getcomponent().sprite" and somehow use that string to get the sprite variable but that will be expensive if i do it every frame
asdsdsad.png
(23.3 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613060515im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity 2D: Accessing variables from another script(Problem) 0 Answers
How to get the value from several InputFields using one script 0 Answers
How do I reference int from other script 0 Answers
Access gameobject from a different scene... 1 Answer
Access To a Variable of another script which in another scene 0 Answers