Serialized Field Rename Guard OFFICIAL SALE

You rename a field. Unity stores Inspector values under the field name, so the value saved as "oldSpeed" no longer matches anything. Every prefab, every scene and every ScriptableObject that used that script falls back to zero.


Nothing warns you. No console message, no icon, no dialog. The project compiles, the scene opens, and the numbers are simply gone. Most people find out in play mode, hours or days later, and blame the wrong change.


Serialized Field Rename Guard watches every compilation. The moment a field is renamed, it tells you - while the values are still recoverable - and puts them back with one click.


WHY THE VALUES CAN STILL BE RECOVERED


Unity has an answer for this: [FormerlySerializedAs("oldName")]. With that attribute on the renamed field, the next import reads the value stored under the old name and hands it to the new one.


The catch is timing. Nobody thinks of it before renaming, and by the time you notice the damage, the usual instinct - open the scene, look around, save - is exactly what destroys the data.


On disk, your prefab still contains the line "oldSpeed: 12". Unity ignores that unknown key, but it does not erase it: the line survives until the file is written again. This tool exists to write the attribute during that window, and it opens by itself so you cannot miss it.


WHAT YOU ACTUALLY DO


Rename your field the way you always have, and save. Unity compiles. The window opens with the pairing already made: oldSpeed -> newSpeed. Click "Count values at risk" to see how many values are still stored under the old name, then "Recover the values". Unity reimports, and your Inspector is exactly as you left it.


One line is added to your script, plus the using directive if it was missing. Your indentation, line endings and file encoding are preserved. Nothing is written until you press the button.


IT PAIRS, YOU CONFIRM


A field that disappeared from a class and a field of the same type that appeared in it, between two compilations: that is a rename. When the pairing can only be one thing, it is pre-selected. As soon as several fields of the same type moved at once, you pick from the list yourself - guessing would write the wrong old name into your script.


A rename you have not answered yet comes back after the next compilation, until you repair it or dismiss it for good.


WHAT YOU GET


- A check after every compilation, which is the only moment that matters.

- The window opens on its own, or stays quiet and reports to the console - your choice.

- The count of values still stored under the old name, read from every prefab, scene and asset file of the project.

- A safe edit of your script: it only writes on a declaration it can identify with certainty, and refuses to write otherwise.

- Fields covered: public and [SerializeField] private, arrays and lists, fields inside plain [Serializable] classes, fields declared in a base or abstract MonoBehaviour.

- A snapshot stored in ProjectSettings: outside Assets, versionable, shared by the whole team.

- The line it wrote is watched: if a code editor saves an older copy of the file back over it and wipes the attribute, the rename is raised again instead of failing silently.


HONEST NOTES


[FormerlySerializedAs] is standard Unity, and free. What this package gives you is the detection at the right moment, the pairing, the count of what is at risk, and a safe edit of the file. If you already add the attribute by reflex before every rename, you do not need this tool.


And if the scenes and prefabs holding those values have already been saved since the rename, the old values were rewritten and are gone - no tool can bring them back, only your version control. The window tells you how many are still there, so you always know what you are recovering.


WHAT IT DOES NOT COVER


Renaming a class, and reordering or removing an enum member. Both lose data too, both are a different mechanism, and repairing them means rewriting values inside your assets - which this tool deliberately never does.


COMPATIBILITY


Unity 2022.3 or newer. Editor only: nothing ships in your build. No third-party dependencies. Built-in, URP and HDRP.