子对象相关

2017-09-06  本文已影响0人  Pomelo的笔记本

设置游戏对象的子对象

sonObject.transform.parent = fatherObject.transform;

获取子对象的数量

father.transform.childCount;

遍历子对象

foreach (Transform child in father.transform){
  Debug.log(child.gameObject.name);
}
上一篇下一篇

猜你喜欢

热点阅读