指定したGameObject直下のGameObjectだけを返す関数。
|
1 2 3 4 5 6 7 8 |
public List<GameObject> GetChildGameObject(GameObject parentObj) { List<GameObject> childrenObj = new List<GameObject>(); foreach (Transform child in parentObj.transform) { childrenObj.Add(child.gameObject); } return childrenObj; } |





![Unity – 容量削減作業に便利なツール [win]](https://i0.wp.com/mizutanikirin.net/blog/wp-content/uploads/2015/09/tool1-150x150.jpg?resize=150%2C150&ssl=1)


コメントを残す