- Home /
Will renaming a Serializable class wipe its instances in the Inspector?
I have a class named MenuItem and just recently, I found out the namespace "MenuItem" is used by editor extensions such as Prototype, so I'm looking into changing it. I'd like to know if I'll have to define all of my menus all over again.
Your question title and body don't match. Just rename your class, most IDEs have basic refactoring/rena$$anonymous$$g functionalities. What IDE you're using? if any?
I guess I'm using the built-in Unity IDE, if that's a thing.
Answer by Landern · Oct 07, 2014 at 08:08 AM
I've actually had good luck with this. Doing multiple conversions from UnityScript(JavaScript) to C# and copying the scene(originals done with scripts in UnityScript) to include my c# scripts, i have been able to keep the properties/fields with the same names between the scripts and replace the UnityScript version with the c# version and the values carried over. But your scripts may be different, i'm not sure. It would be wise to backup and give a go on the backup and not the main code base(or if you us SVN/GIT/ETC just revert if failure).
I just tried it the way Landern suggested and had no problem. Unity metadata is pretty resilient. You can rename scripts, change namespaces and even remove and return fields and the metadata will stay intact.
Your answer
Follow this Question
Related Questions
Logic Problems using for loops 0 Answers
How to set a shared material in inspector? 0 Answers
How do I get the default scene GUI for a CustomEditor for RectTransform? 1 Answer
Is there an event being fired off when the Inspector is being resized? 1 Answer
How to get notification of moving a GameObject in the hierachy when editing the scene? 1 Answer