12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using UnityEngine;
- using System.Collections;
- namespace TMPro.Examples
- {
-
- public class SimpleScript : MonoBehaviour
- {
- private TextMeshPro m_textMeshPro;
-
- private const string label = "The <#0050FF>count is: </color>{0:2}";
- private float m_frame;
- void Start()
- {
-
- m_textMeshPro = gameObject.AddComponent<TextMeshPro>();
- m_textMeshPro.autoSizeTextContainer = true;
-
-
-
-
-
-
-
-
- m_textMeshPro.fontSize = 48;
- m_textMeshPro.alignment = TextAlignmentOptions.Center;
-
-
-
-
-
-
- m_textMeshPro.enableWordWrapping = false;
-
- }
- void Update()
- {
- m_textMeshPro.SetText(label, m_frame % 1000);
- m_frame += 1 * Time.deltaTime;
- }
- }
- }
|