Page 1 of 1

How do I restore all Settings to default when I return to the main menu?

Posted: Fri Jan 24, 2025 3:16 am
by hhyu
I am currently using both the Dialogue System and Quest Machine. When saving, I use:

gameSaveData.DialogueData = PersistentDataManager.GetSaveData();
gameSaveData.QuestDataDict = SaveSystem.Serialize(SaveSystem.RecordSavedGameData());

When loading, I use:

PersistentDataManager.ApplySaveData(gameSaveData.DialogueData);
SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(gameSaveData.QuestDataDict));

However, there's an issue: when returning to the main menu, I need to reset both components to their default states. Otherwise, when starting a new game again, the old data persists and contaminates the new game session.

Re: How do I restore all Settings to default when I return to the main menu?

Posted: Fri Jan 24, 2025 8:03 am
by Tony Li
Hi,

Call PixelCrushers.SaveSystem.ResetGameState(). This will reset all saver data to default.