Prefab script & reset

Hi all,

I have a script attached to a prefab.
Whenever I modify and save the script (eg. the value of a public variable), the changes are not made immediately to the prefab. The prefab still show old values.
I must use the reset option to reset the prefab.

Why?

Thanks in advance

As far as I know once you save a script with a public variable, changing it within the script afterwards will not actually do anything. Try cutting it (ctrl + x) saving the script then pasting it back in change the values and save it again. This will reset the value in unity.

It would be utter chaos if that’s what happened. Every single GameObject that uses that script would have its values changed, requiring you to go through your entire project and change all the values back.

Is there a way to update the script of all prefab or all instances automatically?

Anyone?
Thanks in advance.

What about writing an editor script? You could add a [MenuItem] that calls Resources.LoadAll() to load all resources into memory (if you have enough RAM) then iterates through Resources.FindObjectsOfTypeAll(), calling Reset() on them all. If LoadAll() is too heavy, you can use System.IO.Directory.GetFiles() to manually look at each file in your Asets folder.

Thanks a lot.
@TonyLi : Your method is so advanced that I may try it in future.