如何用 代码 控制 text 文本
-------------------------------------------------------------------------------代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//使用 该引用,才能获得 Text 组件。
public class test : MonoBehaviour {
public GameObject GO;
public GUIText guit;
// Use this for initialization
void Start () {
GO.GetComponent<Text>().text = "6666";
}
}
-------------------------------------------------------------------------------
参考资料:
1.
UGUI文本字体颜色和大小等代码修改
2.
3.
4.
5.
6.
7.