public void LoadData() { //Load the data from the XML File SaveData data = XMLSaving.ReadData(); //If data isnt equal to null if (data != null) { for (int i = 0; i < saveSlots.Length; i++) { saveSlots[i].player = data.playerName[i]; //set the wave in high to the wave in data saveSlots[i].level = data.level[i]; saveSlots[i].turn = data.turn[i]; } } else //else if data is null { for (int i = 0; i < saveSlots.Length; i++) { //Set the player to blank saveSlots[i].player = "Blank"; //Set the wave to zero saveSlots[i].level = 0; saveSlots[i].turn = 0; } } //Sort the score data Sort(); }
public void LoadData() { //Load the data from the XML File HighScores data = XMLSaving.ReadData(); //If data isnt equal to null if (data != null) { //for all high for (int i = 0; i < high.Length; i++) { //Set the player in high to player playername in data high[i].player = data.playerName[i]; //set the distance in high to the wave in data high[i].dis = data.wave[i]; } } else //else if data is null { //for each high for (int i = 0; i < high.Length; i++) { //Set the player to blank high[i].player = "Blank"; //Set the distance to zero high[i].dis = 0; } } //Sort the score data Sort(); }