12345678910111213141516171819202122232425262728293031 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- [RequireComponent(typeof(Text))]
- public class UITextStyleComponent : MonoBehaviour {
- public string styleName;
- private Text text;
- // Use this for initialization
- void Start () {
-
- SystemLanguage language = LanguageManager.s_currentLanguage;
- SetTextStyleData(language);
- }
-
- // Update is called once per frame
- public void SetTextStyleData (SystemLanguage language)
- {
- if(text==null)
- text = GetComponent<Text>();
- if (string.IsNullOrEmpty(styleName))
- return;
- UITextStyleManager.SetText(text, styleName, language);
- }
- }
|