// Start is called before the first frame update void Start() { if (dropdown != null && studyCardObjects != null && studyCardObjects.Count > 0) { dropdown.options = new List <TMPro.TMP_Dropdown.OptionData>(); foreach (var card in studyCardObjects) { dropdown.options.Add(new TMPro.TMP_Dropdown.OptionData( card.topic )); } } if (dropdownLabel != null && studyCardObjects != null && studyCardObjects.Count > 0) { dropdownLabel.text = studyCardObjects[0].topic; } if (studyCardObjects != null && studyCardObjects.Count > 0) { selectedStudyCard = studyCardObjects[0]; } BackToMenu(); }
public void onDropDownValueChanged(int index) { if (dropdownLabel != null) { dropdownLabel.text = studyCardObjects[index].topic; } selectedStudyCard = studyCardObjects[index]; }