Page 1 of 1
How to save without using save system?
Posted: Sat Oct 26, 2024 3:42 am
by hhyu
Re: How to save without using save system?
Posted: Sat Oct 26, 2024 10:42 am
by Tony Li
Hi,
It's just one line of code to save, one line of code to restore. Set up the save system savers, and to save to a string or object:
Code: Select all
string s = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());
//or:
SavedGameData data = SaveSystem.RecordSavedGameData();
Then save that to your save system.
To restore:
Code: Select all
SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(s));
Untick the SaveSystem component's Save Current Scene checkbox since your save system will presumably take care of that.