private void SetLocalization(int index) { if (gameObject.activeInHierarchy) { StartCoroutine(LocManager.LoadLocalizationAsync(index)); } }
private void OnLocChanged() { if (IsInitialized) { // Set current selection to correct value _target.value = LocManager.LoadedLoc; return; } // Populate with all languages _target.ClearOptions(); var languages = new List <string>(LocManager.GetLanguages()); _target.AddOptions(languages); // Set current selection to correct value _target.value = LocManager.LoadedLoc; // Add listener to set localization when a value is selected _target.onValueChanged.AddListener(SetLocalization); IsInitialized = true; }