Hello,
I noticed how when a person writes a variable inside a script and assigns a default value to it outside of a function, all the objects that use that script will show up in the inspector with that assigned value to it inside the script by default. Then, people can manually change the value for each script inside the inspector.
The problem happens when people try to change the default value again inside the script. The default values won’t change inside the inspector. Instead, people have to comment out the lines of code that use that variable, delete the variable, save and compile the script, then un-comment out those lines, recreate the variable again with the new default value and then save and recompile the script again before all the default values will change inside the inspector. Is there a way where only the default values inside the inspector that have not been changed manually will change to the new default values assigned by the scripts?
Maybe programmers could (in the future) change all the values in each script to a default value using a pragma command with its variable under it. Example…
@ChangeAllValues
var default : String = “New value”;