/// <summary> /// Load all saved games into the save game panel. /// </summary> protected void LoadSavedGames() { // Destroy all of this GameObject's children (representing the different save files) to start fresh. this.saveGameViewContent.DestroyAllChildren(); // For each save file, add a node to the content viewer for that save file. foreach (string saveFileName in SaveGameManager.GetSaveFileNames()) { // Ignore files that don't end in TSCGAME or have more than one period. if (IsInvalidFileName(saveFileName)) { continue; } // Otherwise, add a brand new save file node. this.saveGameViewContent.AddChild(this.CreateSavedGameTextItem(saveFileName), false); } // Scroll the list back all the way to the top. this.scrollBar.value = 1; }