C# Serialized Data Migration
The following is intended for informational purposes only, and may not be incorporated into any contract. No purchasing decisions should be made based on the following materials. Unity is not committing to deliver any functionality, features or code. The development, timing and release of all products, functionality and features are at the sole discretion of Unity, and are subject to change.
If you have accepted to use functional cookies and logged in using your Unity ID at the top right of the page, then sharing feedback is as simple as clicking a card below, selecting a topic’s importance, adding your point of view, and submitting. If you prefer not to accept functional cookies or log in, you will be prompted to enter an email address and validate it, so we know how to reach out when the topic evolves. For more information read the Feedback and privacy terms.
Over the lifetime of a serialized C# type (MonoBehaviour, ScriptableObject, etc.), data often undergoes schema changes. These changes include:
- renaming fields
- changing the type of a field (including to and from simple, struct, aggregate, array, list, or serialized reference types)
- combining multiple fields into a single field, or splitting a single field into multiple fields
- changing the meaning of one or more fields, adding default values to new fields according to the others, processing data during version changes
- refactoring a single Object into multiple types
- combining multiple Objects into a single type
- changing the type of an Object
Of all of these, the only supported change right now is renaming fields ([FormerlySerializedAs]).
This feature will provide a built-in system in Unity that supports data migration of serialized data, covering the use cases listed above.