public void RefreshSaveSlots() { saveGames = SaveUtility.ObtainAllSaveGames().OrderByDescending(save => (DateTime.Now - save.Value.saveDate)).ToList <KeyValuePair <int, SaveGame> >(); if (saveGames.Count == 0) { confirmationWindow?.Reference?.GetComponent <ConfirmationWindow>().Configure(new ConfirmationWindow.Configuration() { acceptOnly = true, question = "No save games found", answerYes = "Okay" }); this.gameObject.SetActive(false); return; } LoadSlots(currentTabIndex); }
public static SaveGame LoadSave(int slot) { #if UNITY_WEBGL && !UNITY_EDITOR SyncFiles(); #endif Log($"Attempting to load game at slot: {slot}"); SaveGame getSave; if (SaveUtility.ObtainAllSaveGames().TryGetValue(slot, out getSave)) { Log($"Succesful load at slot: {slot}"); return(getSave); } else { Log($"Could not load game at slot {slot}"); return(null); } }