public void SaveGameDataApple() // save the data of the player { gameData newData = new gameData(); string path = Application.streamingAssetsPath + "/AppleLogs.json"; foreach (GameLog log in ApplePicker.logs) // for each log in Apple pickers logs { newData.Add(log); // add the new game data } File.WriteAllText(path, JsonUtility.ToJson(newData)); // write log into system }
public void SaveGameData() { gameData newData = new gameData(); string path = Application.streamingAssetsPath + "/gameLogs.json"; foreach (GameLog log in ApplePickerMenu.logs) { newData.Add(log); } Debug.Log(JsonUtility.ToJson(newData)); File.WriteAllText(path, JsonUtility.ToJson(newData)); }