Example #1
0
 void OnKeySet(string languageCode, LocalizationKey changedKey)
 {
     if (changedKey.key == targetKey)
     {
         UpdateLocalizeText();
     }
 }
Example #2
0
        public string GetText(string key)
        {
            LocalizationKey lk = GetLocalizationKey(key);

            if (lk != null)
            {
                return(lk.textValue);
            }
            else
            {
                return("");
            }
        }
Example #3
0
        public void RemoveKey(string key)
        {
            LocalizationKey lk = GetLocalizationKey(key);

            if (lk != null)
            {
                keys.Remove(lk);
            }

            #if UNITY_EDITOR
            EditorUtility.SetDirty(this);
            #endif
        }
Example #4
0
        public void SetKey(string key, string textValue)
        {
            LocalizationKey lk = GetLocalizationKey(key);

            if (lk == null)
            {
                keys.Add(new LocalizationKey(key, textValue));
            }
            else
            {
                lk.textValue = textValue;
            }

            #if UNITY_EDITOR
            EditorUtility.SetDirty(this);
            #endif

            if (!Application.isPlaying && OnKeySet != null)
            {
                OnKeySet(code, new LocalizationKey(key, textValue));
            }
        }