2016-04-14 37 views

回答

4

您在使用ObjectFindGameObjectsWithTag 'S'。在Object中使用FindGameObjectWithTag而不是's'。该函数的's'版本用于数组,但是g未定义为数组。

这行代码应该是:

g = GameObject.FindGameObjectWithTag("tagText No"); 
2

FindGameObjectsWithTag返回一个游戏对象数组(GameObject[]),并且您试图将其分配到一个GameObject

使用FindWithTag代替:

g = GameObject.FindWithTag("tagText no"); 
+0

谢谢主席先生给了答案 –

相关问题