設(shè)置游戲?qū)ο蟮淖訉ο?/p>
sonObject.transform.parent = fatherObject.transform;
獲取子對象的數(shù)量
father.transform.childCount;
遍歷子對象
foreach (Transform child in father.transform){
Debug.log(child.gameObject.name);
}
設(shè)置游戲?qū)ο蟮淖訉ο?/p>
sonObject.transform.parent = fatherObject.transform;
獲取子對象的數(shù)量
father.transform.childCount;
遍歷子對象
foreach (Transform child in father.transform){
Debug.log(child.gameObject.name);
}