private static Transform MapBipedBone(int boneIndex, Transform transform, Transform parentTransform, List<string> report)
{
Transform child = null;
if (transform != null)
{
int childCount = transform.childCount;
for (int i = 0; (child == null) && (i < childCount); i++)
{
if (transform.GetChild(i).name.EndsWith(kBipedHumanBoneNames[boneIndex]))
{
child = transform.GetChild(i);
if (((child != null) && (report != null)) && ((boneIndex != 0) && (transform != parentTransform)))
{
string[] textArray1 = new string[] { "- Invalid parent for ", child.name, ".Expected ", parentTransform.name, ", but found ", transform.name, "." };
string item = string.Concat(textArray1);
if ((boneIndex == 1) || (boneIndex == 2))
{
item = item + " Disable Triangle Pelvis";
}
else if ((boneIndex == 11) || (boneIndex == 12))
{
item = item + " Enable Triangle Neck";
}
else if (boneIndex == 9)
{
item = item + " Preferred is two Spine Links";
}
else if (boneIndex == 10)
{
item = item + " Preferred is one Neck Links";
}
item = item + "\n";
report.Add(item);
}
}
}
for (int j = 0; (child == null) && (j < childCount); j++)
{
child = MapBipedBone(boneIndex, transform.GetChild(j), parentTransform, report);
}
}
return child;
}