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

#if UNITY_EDITOR
            textProxy.CheckFontInConfig();
#endif
        }
예제 #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();
            }
        }
예제 #3
0
        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;
        }
예제 #4
0
파일: I18nText.cs 프로젝트: lvshiling/Nova
        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;
            }
        }
예제 #5
0
        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;
        }
예제 #6
0
 private void OnEnable()
 {
     textProxy.Init();
     textProxy.UpdateFont();
     I18n.LocaleChanged.AddListener(textProxy.UpdateFont);
 }