Quantcast
Channel: Latest Questions by Santa
Viewing all articles
Browse latest Browse all 88

FieldInfo.GetValue with GameObject field

$
0
0
Using FieldInfo.GetValue with GameObject field doesn't work. --- Code always gives null result: public GameObject someVar; ... GameObject go = fieldInfo.GetValue(parentScript) as GameObject; --- While the same with any Component works fine: public Transform someVar; ... Transform tr = fieldInfo.GetValue(parentScript) as Transform; --- Why could it be? Is it possible to get GameObject variable through reflection? Thanks

Viewing all articles
Browse latest Browse all 88

Trending Articles



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