public static Transform SearchBone(Transform current, string name)
{
if (current.name.Equals(name))
return current;
for (int i = 0; i < current.childCount; ++i)
{
Transform found = SearchBone(current.GetChild(i), name);
if (found != null)
return found;
}
return null;
}
网友评论