Hi,
The Dialogue System's save system can save and restore the current scene that the player is in. That might make it simpler. To tell the save system to remember which scene the player was in, tick the Save System component's "Save Current Scene" checkbox. (This checkbox is ticked by default.)
Then you can use code like this:
Code: Select all
if (SaveSystem.HasSavedGameInSlot(active_slot))
{
SaveSystem.LoadFromSlot(active_slot);
}
else
{
SaveSystem.RestartGame("Area 0");
}
Note: Alternatively, you can add a Save System Methods component to a UI Button GameObject. Then configure the UI Button's OnClick() event to call SaveSystemMethods.LoadOrRestart(slot#). If there is a saved game in the slot, it will load it. Otherwise it will restart a new game at the scene specified by the Save System Methods component's Default Starting Scene Name.