Quantcast
Channel: Latest Questions by eaglemaster7
Viewing all articles
Browse latest Browse all 18

assign variable via reflection mode

$
0
0
I am trying to set spesific variable via text information; so I found this : ---------------- GameObject.Find(NameOfGameObject) .GetComponent(NameOfComponent).GetType() .GetField(NameOfVariable) .SetValue(GameObject.Find(NameOfGameObject) .GetComponent(NameOfComponent), ValueToSet); ---------------------------- this is a sigle line code, and the code work fine for any variable types,(just parse it) but the question is how to assign GameObject by this way, I tried GameObject.Find(Value) but doesn't work. Any help will be appreciated :)

Viewing all articles
Browse latest Browse all 18

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>