Save system - how to load basic scene if there is no save on slot
Posted: Fri Sep 09, 2022 1:52 pm
I have this code:
So I am loading basic scene Area 0, and then I am loading save according to pressed slot, 1,2 or 3 and assign that number to active_slot var here. If all slots has no saves, and I choose slot number 1 for example and then save progress, then back to menu and choose for example slot 2 or 3 that is empty, game loads status from slot number 1, but should load basic scene Area 0. I dont know I explained it well but I dont know how to load basic scene in case if there is no save on slot.
Code: Select all
public void OnSlotPressed()
{
int active_slot = GameManager.Instance.currentSaveSlot;
SaveSystem.LoadScene("Area 0");
if (SaveSystem.HasSavedGameInSlot(active_slot)) SaveSystem.LoadFromSlot(active_slot);
}