- Home /
Set script global variable value priority over editor values
It looks like the global variable values in a script are overwritten by the editor values. Is there a way to switch priority back to the global variables?
Comment
Answer by Mike 3 · May 08, 2011 at 02:27 AM
You can use the NonSerialized attribute - http://unity3d.com/support/documentation/ScriptReference/NonSerialized.html
It won't be visible in the normal inspector at that point, but the variable will still be public at least
What's the difference between serialized and nonserialized variables in this context?
SerializeField ones are ones which get shown in the inspector and stored/set via the engine, NonSerialized are the opposite.