Transform Find(Transform transRoot, string childName)
{
Transform ret = null;
for (int i = 0; i < transRoot.childCount; i++)
{
Transform child = transRoot.GetChild(i);
if (child.name == childName)
{
ret = child;
break;
}
ret = Find(child, childName);
if (ret != null)
{
break;
}
}
return ret;
}
for (int i = 0; i < allBonesNames.Count; ++i)
{
allBones.Add(Find(rootTrans, allBonesNames[i]));
}