void SaveGameStatus() { OnGameSave?.Invoke(); var obj = GameObject.FindGameObjectWithTag("SceneManager"); if (obj == null) { return; //The game is not currently running, so nothing to save. } var mapdata = obj.GetComponent <MapManager>().SerializeMapData(); using (StreamWriter SW = new StreamWriter(Path.Combine(AppdataPath, "Map.json"))) { SW.Write(mapdata); } }
/// <summary> /// Saves everything about the game. /// </summary> public static void SaveGame() { OnGameSave?.Invoke(); }