getcomponent unity的问题
UnityEngine.GameObject[]dosenotcontainadefinitionfor‘Getcomponent’voidAwake(){player=...
UnityEngine.GameObject [] dose not contain a definition for ‘Getcomponent’
void Awake()
{
player = GameObject.FindWithTag ("Player");
playerSpawnCTRL = GameObject.FindGameObjectsWithTag("PlayerSpawnCTRL").GetComponent<PlayerSpawnController> ();
}
为什么会报错呢,我看别人教程都是这样写的都没错 展开
void Awake()
{
player = GameObject.FindWithTag ("Player");
playerSpawnCTRL = GameObject.FindGameObjectsWithTag("PlayerSpawnCTRL").GetComponent<PlayerSpawnController> ();
}
为什么会报错呢,我看别人教程都是这样写的都没错 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏10(财富值+成长值)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询