Пример #1
0
        private void SetupSaveFilePreview()
        {
            var buttonsTexts = FindObjectsOfType <TextMeshProUGUI>();

            saveFileTexts[0] = buttonsTexts.Single(t => t.name == "File1Button_Text");
            saveFileTexts[1] = buttonsTexts.Single(t => t.name == "File2Button_Text");
            saveFileTexts[2] = buttonsTexts.Single(t => t.name == "File3Button_Text");
            saveFileTexts[3] = buttonsTexts.Single(t => t.name == "File4Button_Text");
            saveFileTexts[4] = buttonsTexts.Single(t => t.name == "File5Button_Text");

            saveFiles = SaveDataManager.FindAllSaveFiles();
            foreach (var saveFile in saveFiles)
            {
                saveFileTexts[saveFile.SaveFileNr - 1].text = "File " + saveFile.SaveFileNr + " - " + saveFile.CurrentLevel;
            }
        }