You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
tylkomat
changed the title
[Question] Update property name
[Question] Update serialized property name
Sep 24, 2020
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.
The
mentor
field is currently serialized asmentorName
. With the changes the serialized field name would bementorUid
. This is handled by theCharacterDataConverter
, but this has to be updated all the time whenCharacterData
class changes and is often forgotten.Much simpler would be to use
fsProperty
:But this can handle only either
mentorName
ormentorUid
.Is there another solution? Maybe using versioning?
The text was updated successfully, but these errors were encountered: