Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Prompt the user before deleting serialized value

Discussion in 'Editor & General Support' started by yyylny, Nov 27, 2019.

  1. yyylny

    yyylny

    Joined:
    Sep 19, 2015
    Posts:
    53
    I'd like to suggest a small but useful new feature for the editor: if a serialized value is renamed (or removed), prompt the user before deleting the serialized value. For example, a message box like this after the code changes:

    Warning: Serialized Value Changed

    The serialized property "myProperty" of the object "My Object" has been removed from file script "MyObject.cs". What would you like to do with the serialized data?

    [Remove Data] [Copy Data] [Cancel]​

    So clicking the Remove Data button proceeds as usual, clicking the Copy Data button lets you pick another property and adds the [FormerlySerializedAs] attribute to it, and the Cancel buttons cancels the whole compilation process until the user manually changes the code.

    I'm sure it'll save users a lot of time.
     
unityunity