private static MapBipedBone ( int boneIndex, |
||
boneIndex | int | |
transform | ||
parentTransform | ||
report | List |
|
return |
private static bool MapBipedBones(Transform root, ref Transform[] humanToTransform, List <string> report) { bool result; for (int i = 0; i < AvatarBipedMapper.s_BipedBones.Length; i++) { int index = AvatarBipedMapper.s_BipedBones[i].index; int parentBone = HumanTrait.GetParentBone(index); bool flag = HumanTrait.RequiredBone(index); bool flag2 = parentBone == -1 || HumanTrait.RequiredBone(parentBone); Transform transform = (parentBone == -1) ? root : humanToTransform[parentBone]; if (transform == null && !flag2) { parentBone = HumanTrait.GetParentBone(parentBone); flag2 = (parentBone == -1 || HumanTrait.RequiredBone(parentBone)); transform = ((parentBone == -1) ? null : humanToTransform[parentBone]); if (transform == null && !flag2) { parentBone = HumanTrait.GetParentBone(parentBone); transform = ((parentBone == -1) ? null : humanToTransform[parentBone]); } } humanToTransform[index] = AvatarBipedMapper.MapBipedBone(i, transform, transform, report); if (humanToTransform[index] == null && flag) { result = false; return(result); } } result = true; return(result); }
private static bool MapBipedBones(Transform root, ref Transform[] humanToTransform, List <string> report) { bool result; for (int i = 0; i < HumanTrait.BoneCount; i++) { string a = AvatarBipedMapper.kBipedHumanBoneNames[i]; int parentBone = HumanTrait.GetParentBone(i); bool flag = HumanTrait.RequiredBone(i); bool flag2 = parentBone == -1 || HumanTrait.RequiredBone(parentBone); Transform transform = (parentBone == -1) ? root : humanToTransform[parentBone]; if (transform == null && !flag2) { parentBone = HumanTrait.GetParentBone(parentBone); transform = ((parentBone == -1) ? null : humanToTransform[parentBone]); } if (a != "") { humanToTransform[i] = AvatarBipedMapper.MapBipedBone(i, transform, transform, report); if (humanToTransform[i] == null && flag) { result = false; return(result); } } } result = true; return(result); }
private static bool MapBipedBones(Transform root, ref Transform[] humanToTransform, List <string> report) { for (int index = 0; index < HumanTrait.BoneCount; ++index) { string bipedHumanBoneName = AvatarBipedMapper.kBipedHumanBoneNames[index]; int parentBone1 = HumanTrait.GetParentBone(index); bool flag1 = HumanTrait.RequiredBone(index); bool flag2 = parentBone1 == -1 || HumanTrait.RequiredBone(parentBone1); Transform transform = parentBone1 == -1 ? root : humanToTransform[parentBone1]; if ((Object)transform == (Object)null && !flag2) { int parentBone2 = HumanTrait.GetParentBone(parentBone1); transform = parentBone2 == -1 ? (Transform)null : humanToTransform[parentBone2]; } if (bipedHumanBoneName != string.Empty) { humanToTransform[index] = AvatarBipedMapper.MapBipedBone(index, transform, transform, report); if ((Object)humanToTransform[index] == (Object)null && flag1) { return(false); } } } return(true); }
private static Transform MapBipedBone(int bipedBoneIndex, Transform transform, Transform parentTransform, List <string> report) { Transform transform2 = null; if (transform != null) { int childCount = transform.childCount; int num = 0; while (transform2 == null && num < childCount) { string name = AvatarBipedMapper.s_BipedBones[bipedBoneIndex].name; int index = AvatarBipedMapper.s_BipedBones[bipedBoneIndex].index; if (transform.GetChild(num).name.EndsWith(name)) { transform2 = transform.GetChild(num); if (transform2 != null && report != null && index != 0 && transform != parentTransform) { string text = string.Concat(new string[] { "- Invalid parent for ", transform2.name, ". Expected ", parentTransform.name, ", but found ", transform.name, "." }); if (index == 1 || index == 2) { text += " Disable Triangle Pelvis"; } else if (index == 11 || index == 12) { text += " Enable Triangle Neck"; } else if (index == 9) { text += " Preferred is three Spine Links"; } else if (index == 10) { text += " Preferred is one Neck Links"; } text += "\n"; report.Add(text); } } num++; } int num2 = 0; while (transform2 == null && num2 < childCount) { transform2 = AvatarBipedMapper.MapBipedBone(bipedBoneIndex, transform.GetChild(num2), parentTransform, report); num2++; } } return(transform2); }
private static Transform MapBipedBone(int boneIndex, Transform transform, Transform parentTransform, List <string> report) { Transform transform1 = (Transform)null; if ((Object)transform != (Object)null) { int childCount = transform.childCount; for (int index = 0; (Object)transform1 == (Object)null && index < childCount; ++index) { if (transform.GetChild(index).name.EndsWith(AvatarBipedMapper.kBipedHumanBoneNames[boneIndex])) { transform1 = transform.GetChild(index); if ((Object)transform1 != (Object)null && report != null && (boneIndex != 0 && (Object)transform != (Object)parentTransform)) { string str1 = "- Invalid parent for " + transform1.name + ".Expected " + parentTransform.name + ", but found " + transform.name + "."; if (boneIndex == 1 || boneIndex == 2) { str1 += " Disable Triangle Pelvis"; } else if (boneIndex == 11 || boneIndex == 12) { str1 += " Enable Triangle Neck"; } else if (boneIndex == 9) { str1 += " Preferred is two Spine Links"; } else if (boneIndex == 10) { str1 += " Preferred is one Neck Links"; } string str2 = str1 + "\n"; report.Add(str2); } } } for (int index = 0; (Object)transform1 == (Object)null && index < childCount; ++index) { transform1 = AvatarBipedMapper.MapBipedBone(boneIndex, transform.GetChild(index), parentTransform, report); } } return(transform1); }