예제 #1
0
 private void SetLocalization(int index)
 {
     if (gameObject.activeInHierarchy)
     {
         StartCoroutine(LocManager.LoadLocalizationAsync(index));
     }
 }
예제 #2
0
        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;
        }