Esempio n. 1
0
    public void SetText()
    {
        Translation t = polyglot.GetTranslationByName(nameId, lc.selectedLanguage);

        if (t != null)
        {
#if TMP
            if (textP != null)
            {
                this.textP.text = t.translation;
            }
#endif

            if (text != null)
            {
                this.text.text = t.translation;
            }
            else if (t.isDropdown == true)
            {
                int i = 0;
                foreach (var a in t.dropdownTranslation)
                {
                    if (dropdown != null)
                    {
                        dropdown.options [i].text = a.ToString();
                    }

                                        #if TMP
                    if (dropdownTMP != null)
                    {
                        dropdownTMP.options [i].text = a.ToString();
                    }
                                        #endif
                    i++;
                }
                if (dropdown != null)
                {
                    dropdown.captionText.text = dropdown.options [dropdown.value].text;
                }
                                #if TMP
                if (dropdownTMP != null)
                {
                    dropdownTMP.captionText.text = dropdownTMP.options [dropdownTMP.value].text;
                }
                                #endif
            }
        }
    }
    public void SetText()
    {
        Translation t = polyglot.GetTranslationByName(nameId, lc.GetSelectedLanguage());

        if (t != null)
        {
#if TMP
            if (textP != null)
            {
                this.textP.text = t.translation;
            }
#endif

            if (text != null)
            {
                this.text.text = t.translation;
            }
        }
    }
Esempio n. 3
0
    public void SetText()
    {
        this.lc   = GameObject.FindObjectOfType <LanguageControl>();
        this.text = this.GetComponent <Text>();

#if TMP
        this.textP = this.GetComponent <TMP_Text>();
#endif
        Translation t = polyglot.GetTranslationByName(nameId, lc.GetSelectedLanguage());
        if (t != null)
        {
#if TMP
            if (textP != null)
            {
                this.textP.text = t.translation;
            }
#endif

            if (text != null)
            {
                this.text.text = t.translation;
            }
        }
    }