void OnEnable() { dropdown = GetComponent <Dropdown>(); Localization.LocEntry locEntry = Localization.GetLocEntryForKey("LANGUAGE"); PopulateOptions(locEntry); dropdown.value = Localization.GetIndexFromPlayerPref(); dropdown.onValueChanged.AddListener(OnLanguageIndexChanged); }
private void PopulateOptions(Localization.LocEntry le) { dropdown.options.Clear(); for (int i = 0; i < le.translations.Length; i++) { dropdown.options.Add(new Dropdown.OptionData(le.translations[i])); } }