C#代码前需要通过 using UnityEngine.UI; 导入相应类库
GameObject changeFormbtn = GameObject.Find("Canvas/changeFormText"); Button btn = (Button) changeFormbtn.GetComponent<Button>(); Text text = btn.transform.Find("Text").GetComponent<Text>(); text.text = "改变文字2";