设置游戏对象的子对象
sonObject.transform.parent = fatherObject.transform;
获取子对象的数量
father.transform.childCount;
遍历子对象
foreach (Transform child in father.transform){
Debug.log(child.gameObject.name);
}
设置游戏对象的子对象
sonObject.transform.parent = fatherObject.transform;
获取子对象的数量
father.transform.childCount;
遍历子对象
foreach (Transform child in father.transform){
Debug.log(child.gameObject.name);
}