Exemple #1
0
        private void Awake()
        {
            textProxy = GetComponent <TextProxy>();
            textProxy.Init();

#if UNITY_EDITOR
            textProxy.CheckFontInConfig();
#endif
        }
Exemple #2
0
        private void Awake()
        {
            text      = GetComponent <Text>();
            textPro   = GetComponent <TMP_Text>();
            textProxy = GetComponent <TextProxy>();
            this.RuntimeAssert(text != null || textPro != null || textProxy != null,
                               "Missing Text or TMP_Text or TextProxy.");

            if (textProxy != null)
            {
                textProxy.Init();
            }
        }
        private void InitReferences()
        {
            if (inited)
            {
                return;
            }
            textProxy = transform.Find("Text").GetComponent <TextProxy>();
            textProxy.Init();
            goBackButton = transform.Find("Text/GoBackButton").GetComponent <Button>();
            var buttons = transform.Find("Buttons");

            playVoiceButton = buttons.Find("PlayVoiceButton").GetComponent <Button>();
            inited          = true;
        }
Exemple #4
0
        private void UpdateText()
        {
            string str = I18n.__(inflateTextKey);

            if (textProxy != null)
            {
                textProxy.Init();
                textProxy.text = str;
            }
            else if (textPro != null)
            {
                textPro.text = str;
            }
            else
            {
                text.text = str;
            }
        }
        private void InitReferences()
        {
            if (inited)
            {
                return;
            }

            nameBox = transform.Find("Name").GetComponent <Text>();
            var textTransform = transform.Find("Content/Text");

            contentBox   = textTransform.GetComponent <TMP_Text>();
            contentProxy = textTransform.GetComponent <TextProxy>();
            contentProxy.Init();

            verticalLayoutGroup = GetComponent <VerticalLayoutGroup>();
            textLayoutElement   = textTransform.GetComponent <LayoutElement>();

            inited = true;
        }
Exemple #6
0
 private void OnEnable()
 {
     textProxy.Init();
     textProxy.UpdateFont();
     I18n.LocaleChanged.AddListener(textProxy.UpdateFont);
 }