public static void Starter(Dropdown SelectPlatoon, UnityUITable.Table Table, Text PlatoonNameLabel)//реализует процесс инициализации { PlatoonsManager.LoadPlatoons(); SelectPlatoon.options.Clear(); foreach (Platoon platoon in PlatoonsManager.Platoons) { SelectPlatoon.options.Add(new Dropdown.OptionData(platoon.NamePlatoon)); } SelectPlatoon.RefreshShownValue(); SelectPlatoon.value = 0; OnChangePlatoonDropdownOut(SelectPlatoon, Table, PlatoonNameLabel); }
public static void OnChangePlatoonDropdownOut(Dropdown SelectPlatoon, UnityUITable.Table Table, Text PlatoonNameLabel) //внешний обработчик события изменения выбранного взвода { SelectedPlatoon = PlatoonsManager.GetPlatoon(SelectPlatoon.captionText.text); PlatoonNameLabel.text = "Взвод: " + SelectPlatoon.captionText.text; byte number = 1; Students.Clear(); foreach (Student student in SelectedPlatoon.Students) { Students.Add(new Student(student.NameStudent, number)); number++; } Table.UpdateContent(); }