我对 GetComponent(GUIText) 有疑问,我得到的错误是
“#######COUNTER(Clone)”游戏对象没有附加“GUIText”,但脚本正在尝试访问它。
这是我的代码:
var UItecxt = GameObject.Find("#######COUNTER(Clone)");
var txtconvert = UItecxt.GetComponent(GUIText);
print(txtconvert);
txtconvert.text = counternumb.ToString();
我的克隆上有一个 GUIText!问题是什么?谢谢!