public void LoadGame(int slot) { //var slotToLoad = 0; // Set your index here //SaveMaster.ClearSlot(); SaveMaster.SetSlot(slot, true); SceneManager.LoadScene("Level1"); }
private void SaveCurrentData() { SaveMaster.SetSlot(0, false); SaveMaster.SetString("scene", gameObject.scene.name); SaveMaster.WriteActiveSaveToDisk(); Debug.Log("Saved"); }
private void WipeSave() { SaveMaster.DeleteSave(); displayText.text = "Wiped save, created new save at slot 0"; lastestSpeed = 0; SaveMaster.SetSlot(0, true); }
public void SaveSlot(int slot) { SaveMaster.DeleteSave(slot); Debug.Log("Saving"); SaveMaster.SetSlot(slot, false); SaveMaster.WriteActiveSaveToDisk(); //write save to disk Text txt = GetComponentInChildren<Text>(true); txt.fontSize = 13; txt.alignment = TextAnchor.UpperRight; DateTime timeSaved = SaveMaster.GetSaveCreationTime(slot); txt.text = timeSaved.ToString("dd MMMM yyyy hh:mm:ss tt"); }
private void SyncSaveLoad() { var stopWatch = new System.Diagnostics.Stopwatch(); stopWatch.Start(); SaveMaster.ClearSlot(); SaveMaster.SetSlot(0, true); stopWatch.Stop(); displayText.text = stopWatch.Elapsed.TotalMilliseconds.ToString(); lastestSpeed = stopWatch.ElapsedMilliseconds; }
public void LoadButton() { SaveMaster.SetSlot(0, false); string sceneName = SaveMaster.GetString("scene"); if (string.IsNullOrEmpty(sceneName)) { Debug.Log("No level set for this game."); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); } else { // Load the saved scene name SceneManager.LoadScene(sceneName); } }