-
Notifications
You must be signed in to change notification settings - Fork 171
[Question] Update serialized property name #165
Copy link
Copy link
Open
Description
Currently we have some ScriptableObjects that are referenced by their name. This comes with some issues as names may change and also they don't have to be unique. We would like to switch to UUIDs.
using FullSerializer;
[System.Serializable]
[fsObject(Converter = typeof(CharacterDataConverter))]
public class CharacterData
{
public CharacterSO player;
public CharacterSO mentor;
}
The mentor field is currently serialized as mentorName. With the changes the serialized field name would be mentorUid. This is handled by the CharacterDataConverter, but this has to be updated all the time when CharacterData class changes and is often forgotten.
Much simpler would be to use fsProperty:
using FullSerializer;
[System.Serializable]
public class CharacterData
{
[fsProperty(Converter = typeof(PlayerConverter)]
public CharacterSO player;
[fsProperty(Converter= typeof(CharacterSOConverter), Name="mentorName")]
public CharacterSO mentor;
}
But this can handle only either mentorName or mentorUid.
Is there another solution? Maybe using versioning?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels