Page 1 of 1
Save Data
Posted: Sun May 17, 2020 10:33 pm
by claudius_I
Hi Tony
My project use Save Game Pro and i done my save system.
I only want to get all data to save related to Quest Machine. There is a method to get that? or what is the info i need to saved?
Thank Tony
Re: Save Data
Posted: Mon May 18, 2020 10:49 am
by Tony Li
Hi,
Set up Quest Machine's save system components: Add SaveSystem, JsonDataSerializer, and PlayerPrefsSavedGameDataStorer to the Quest Machine GameObject. The PlayerPrefsSavedGameDataStorer won't be used; it just silences a warning about no saved game data storer.
To get Quest Machine's data as a string:
Code: Select all
using PixelCrushers;
...
string s = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());
Then you can save that string using Save Game Pro.
To reapply a string to Quest Machine:
Code: Select all
SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(s));
Re: Save Data
Posted: Mon May 18, 2020 9:52 pm
by claudius_I
thanks Tony
it worked
Re: Save Data
Posted: Tue May 19, 2020 8:26 am
by Tony Li
Great! Glad to help.