Only Save Variables
Posted: Mon Oct 26, 2020 4:25 am
Howdy,
I just want to save the variables in my Dialogue Database between loads/scenes.
In the documentation it says:
Is there more to it than this?
In a script attached to the Dialogue Manager I put:
When I test this, the variables still seem to be unaffected by the save/load.
I feel like I'm missing something here.
Thanks for any help
I just want to save the variables in my Dialogue Database between loads/scenes.
In the documentation it says:
If you only want to save the state of the dialogue database (e.g., dialogue database variables, quest states, and SimStatus), you can bypass the Save System and use PixelCrushers.DialogueSystem.PersistentDataManager instead:
Code: Select all
string s = PersistentDataManager.GetSaveData(); // Save state.
PersistentDataManager.ApplySaveData(s); // Restore state.
DialogueManager.ResetDatabase(DatabaseResetOptions.KeepAllLoaded); // Reset state.
In a script attached to the Dialogue Manager I put:
Code: Select all
string s;
void Update()
{
if (Input.GetKeyDown(KeyCode.S))
{
s = PersistentDataManager.GetSaveData(); // Save state.
}
if (Input.GetKeyDown(KeyCode.C))
{
PersistentDataManager.ApplySaveData(s); // Restore state.
}
}
I feel like I'm missing something here.
Thanks for any help