// Update is called once per frame void Update() { if (Dialogue.Curent == "") { canva.enabled = false; } else { canva.enabled = true; if (Dialogue.dialogue.icone != null) { icon.sprite = Dialogue.dialogue.icone; } lang curLang = lang.findLang(PlayerPrefs.GetString("lang", "Eng"), Dialogue.dialogue.group); txt.text = curLang.findText(Dialogue.dialogue.key).value; if (Input.GetButton("Submit") && TimeLef >= 0.2f) { Dialogue.Curent = Dialogue.dialogue.next; TimeLef = 0; } else { TimeLef += Time.deltaTime; } } }
public langEntry findText(string key) { langEntry res = null; foreach (langEntry entry in entrys) { if (entry.key == key) { res = entry; } } if (res == null) { if (parent != null) { res = parent.findText(key); } } return(res); }