Exemple #1
0
 void OnEnable()
 {
     dropdown = GetComponent <Dropdown>();
     Localization.LocEntry locEntry = Localization.GetLocEntryForKey("LANGUAGE");
     PopulateOptions(locEntry);
     dropdown.value = Localization.GetIndexFromPlayerPref();
     dropdown.onValueChanged.AddListener(OnLanguageIndexChanged);
 }
Exemple #2
0
    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]));
        }
    }