- Home /
Programatically update serialized script variable
I need to get my application's version during runtime (Though this question would be useful for many other things as well).
This is possible in the Unity editor using PlayerSettings.bundleVersion, but the PlayerSettings library isn't available outside of the editor.
How do I update the default value of a variable serialized to a script while that script is running in the editor? (I can of course update that variable by hand in the inspector while the game isn't playing, but I love automating things to reduce the possibility of human error).
Answer by ckfinite · Jun 21, 2011 at 04:56 PM
Thanks! SerializedProperty.stringValue looks like what I need.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Select colour then change texture 0 Answers
Acces to a var from another Script. 2 Answers
How to move value in the inspector to script in the assetbundle 0 Answers
Prefab (Project Folder) to a GameObject (on the Scene) 2 Answers