Renaming Classes

This was mildly confusing, when you renamed the class from EditorSnap to CubeEditor, I’m unsure if you used the rename feature that we use for the functions (that’s what I used - it appears you used some keyboard short cut or plugin - it happened so quickly). As I proceeded this way, I did not get the “rename class” window that appears in the video nor did my script rename itself. Instead, after renaming the class in script, I restarted Unity and then renamed the file in Unity before reapplying it to the cube.

Could you clear up how exactly you renamed the script in a way that gets the file auto-renamed?

This doesn’t answer your question, but might help others:

In Unity 2020.1 with Visual Studio 2019 with Visual Studio 2019 Tools for Unity installed, if you rename a script class name by clicking on it (i.e. click MyClass in public class MyClass : MonoBehaviour) then hit ctrl+r twice (or right click and then Rename) then Unity will automatically detect this and adjust its internals accordingly, with no loss of serialized data. Easy.

Privacy & Terms