public GameObject[] obj;
void Awake()
{
for (int i = 0; i < obj.Length; i++)
{
for (int j = 0; j < obj[i].transform.childCount;j++ )
{
print("obj[i].transform.childCount=" + Enemy_Path[i].transform.childCount);
obj[i].transform.GetChild(j).GetComponent<"想要获取的组件">().enabled = false;
}
}
}
蛮牛博客:http://www.unitymanual.com/home.php?mod=space&uid=8069&do=blog&view=me
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-11-04 18:19:33