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