How do I restore all Settings to default when I return to the main menu?
Posted: Fri Jan 24, 2025 3:16 am
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.
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.