📜  unity 把孩子放在列表中 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:20.194000             🧑  作者: Mango

代码示例1
List children = new List(transform.GetComponentsInChildren());
//!!!!DISCLAMER!!!! This will also include the parent object for whatever reason.
//Heres a less elegant solution that wont include parent:
List children = new List();
foreach (Transform tr in transform) children.Add(tr);