system
1
My script shall provide a text-input-field in inspector to type in a variable-name.
How do I convert this string to a variable I can use in my script afterwards?
jahroy
2
You'll have to use reflection for that:
http://www.csharp-examples.net/reflection-examples/
I recommend restricting the user's input by presenting them with a list of choices, rather than trying to process their raw input. That being said, I don't really know what you're trying to do....
It would be easier for us to help you if you tell us what you're trying to do.
Eric5h5
3
Since you’re using JS, you can use eval(), as long as it’s not a webplayer or iOS/Android.