foreach (Transform child in transform)
{
Debug.Log(child.gameObject.name);
}
转自:http://blog.csdn.net/m_leonwang/article/details/38822455
本文提供了一个使用Unity进行游戏开发时,遍历GameObject下所有子对象的简单示例代码。通过foreach循环,该代码可以打印出每个子对象的名字。
foreach (Transform child in transform)
{
Debug.Log(child.gameObject.name);
}
转自:http://blog.csdn.net/m_leonwang/article/details/38822455
6719
4276
3368
6097
3851

被折叠的 条评论
为什么被折叠?