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;
            }
        }
    }
Exemplo n.º 2
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;
            }
        }
    }
Exemplo n.º 3
0
    public override void OnInspectorGUI()
    {
        //DrawDefaultInspector ();
        script.Update();
        EditorGUI.BeginChangeCheck();

        languageControl.SetSelectedLanguage(EditorGUILayout.Popup("Selected Languages: ", languageControl.GetSelectedLanguage(), languageControl.polyglot.languages.ToArray()));
        EditorGUILayout.PropertyField(LanguageChanged);

        if (EditorGUI.EndChangeCheck())
        {
            script.ApplyModifiedProperties();
        }
    }