您当前的位置: 首页 >  程序员正茂 unity

Unity根据名称递归查找一个物体的子物体

程序员正茂 发布时间:2016-10-28 16:44:30 ,浏览量:7

public static GameObject FindHideChildGameObject(GameObject parent, string childName)
		{
			if(parent.name == childName)
			{
				return parent;
			}
			if(parent.transform.childCount < 1)
			{
				return null;
			}
			GameObject obj = null;
			for(int i = 0;i            
关注
打赏
1688896170
查看更多评论
0.0848s