Hey guys, just started using EasySave and I was a bit disheartened to find out that it doesn't support nested ScriptableObjects out of the box.
It also doesn't look like there has been a tutorial or example showing this use case.
Would love some help. I created a new ES3Type but i'm thinking surely there must be a way to tell ES3 to quickly serialize all sub fields.
Saving Nested ScriptableObjects
Re: Saving Nested ScriptableObjects
Hi there,
Easy Save 3 is capable of saving and loading nested ScriptableObjects. Please could you create a very basic project which replicates your problem and PM it over to me with instructions to replicate it?
Note that fields of UnityEngine.Object types (such as ScriptableObjects) are stored by reference, so if your inner ScriptableObject is generated at runtime, a reference to this will not exist in the reference manager.
All the best,
Joel
Easy Save 3 is capable of saving and loading nested ScriptableObjects. Please could you create a very basic project which replicates your problem and PM it over to me with instructions to replicate it?
Note that fields of UnityEngine.Object types (such as ScriptableObjects) are stored by reference, so if your inner ScriptableObject is generated at runtime, a reference to this will not exist in the reference manager.
All the best,
Joel
-
- Posts: 5
- Joined: Fri May 17, 2019 6:53 pm
Re: Saving Nested ScriptableObjects
Hey Joel I wen't ahead and sent along the example project via pm a few days ago and am eager to see how I might get this working.
Thanks in advance!
Thanks in advance!
Re: Saving Nested ScriptableObjects
Hi there,
Apologies for the delay, it would seem I didn't get a notification regarding your PM. Thanks for your patience.
In your case there's actually an easy workaround in form of a bit of undocumented functionality we have. You can create an ES3Settings object which tells Easy Save's serialiser to store all fields by reference AND value:
Joel
Apologies for the delay, it would seem I didn't get a notification regarding your PM. Thanks for your patience.
In your case there's actually an easy workaround in form of a bit of undocumented functionality we have. You can create an ES3Settings object which tells Easy Save's serialiser to store all fields by reference AND value:
var settings = new ES3Settings(); settings.memberReferenceMode = ES3.ReferenceMode.ByRefAndValue; ES3.Save<Data>("saveData", gameData, "GameData.es3", settings);All the best,
Joel
-
- Posts: 5
- Joined: Fri May 17, 2019 6:53 pm
Re: Saving Nested ScriptableObjects
This seams to be exactly what i'm looking for!
Thanks so much!
It would be great if this was documented as it would probably save someone else a headache haha
Thanks so much!
It would be great if this was documented as it would probably save someone else a headache haha
Re: Saving Nested ScriptableObjects
There are a few edge cases we need to account for, but we're hoping to get this added in a coming update
All the best,
Joel
All the best,
Joel