public static void SaveGameData() { gameDataMemory newData = new gameDataMemory(); string Mempath = Application.streamingAssetsPath + "/MemLogs.json"; foreach (GameLog log in MainMenu.Memlogs) { newData.Add(log); } File.WriteAllText(Mempath, JsonUtility.ToJson(newData)); }
// This is to save the game data public static void SaveGameData() { gameDataMemory newData = new gameDataMemory(); string path = Application.streamingAssetsPath + "/memoryLogs.json"; foreach (GameLog log in logs) { newData.Add(log); } Debug.Log(JsonUtility.ToJson(newData)); File.WriteAllText(path, JsonUtility.ToJson(newData)); }