private void OnDropdownValueChange(int newValue) { var option = speciesDropdown.options[newValue]; FactFiles file = AlFactFiles.Find(x => x.Name == option.text); factText.text = file.FactText; factImage.sprite = GetSpriteForImage(file.Image); }
public void ShowFactFile(string URL) { if (!initted) { Init(); } speciesDropdown.gameObject.SetActive(true); FactFiles file = AlFactFiles.Find(x => URL.Contains(x.URL)); if (file == null) //main list popup { speciesDropdown.value = 1; speciesDropdown.value = 0; } else { var option = speciesDropdown.options.Find(x => x.text == file.Name); speciesDropdown.value = speciesDropdown.options.IndexOf(option); speciesDropdown.gameObject.SetActive(false); } }