public void ClearSaveData() { if (SaveLoadManager.CheckForExistingFile()) { SaveLoadManager.DeleteSaveData(); DataCollector.CheckForSaveFile(); } }
public static void CheckForSaveFile() { if (SaveLoadManager.CheckForExistingFile() == true) { SaveLoadManager.Load(); return; } else { Debug.Log("A new savefile is being written."); tempPlayerDict = new Dictionary <string, Dictionary <string, int> >(); ///level, scoreDict GenerateExampleScorePerLevel(2, 24, jh_Levels[0]); GenerateExampleScorePerLevel(8, 43, jh_Levels[1]); GenerateExampleScorePerLevel(15, 63, jh_Levels[2]); GenerateExampleScorePerLevel(10, 25, pp_Levels[0]); GenerateExampleScorePerLevel(16, 33, pp_Levels[1]); GenerateExampleScorePerLevel(21, 44, pp_Levels[2]); GenerateExampleScorePerLevel(14, 31, pw_Levels[0]); GenerateExampleScorePerLevel(18, 33, pw_Levels[1]); GenerateExampleScorePerLevel(21, 36, pw_Levels[2]); GenerateExampleScorePerLevel(55, 98, hr_Levels[0]); /////for each game... //foreach (KeyValuePair<string, string[]> levelNames in gameLevels) //{ // ///...take every level of that game... // if (levelNames.Key != "Hillrace") // { // for (int k = 0; k < levelNames.Value.Length; k++) // { // Dictionary<string, int> scoreDict = new Dictionary<string, int>(); // ///...and add each template player with a certain score to a new dictionary... // for (int j = 0; j < exampleNames.Length; j++) // { // int newScore = Random.Range(100, 900); //change arbitrary scores to match reality // scoreDict.Add(exampleNames[j], newScore); // } // ///...then add this new dictionary to the actual savegame data and save // tempPlayerDict.Add(levelNames.Value[k], scoreDict); // } // } //} SaveLoadManager.Save(); } }