Beispiel #1
0
 void UpdateL10n()
 {
     if (GetComponent <Text>() != null)
     {
         GetComponent <Text>().text = LanguageSO.GetText(key);
     }
     else if (GetComponent <Button>() != null)
     {
         GetComponentInChildren <Text>().text = LanguageSO.GetText(key);
     }
 }
Beispiel #2
0
    public static string GetText(string key)
    {
        LanguageSO db = Database;

        if (db != null)
        {
            foreach (KeyValueStore kv in db.entries)
            {
                if (kv.key == key)
                {
                    return(kv.value);
                }
            }
        }
        return(string.Empty);
    }
Beispiel #3
0
 public static void LoadDatabase(string language)
 {
     activeDatabase = Resources.Load <LanguageSO>(language);
     updateEvent.Invoke();
 }