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

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