public static HumanBodyBones ToHumanBodyBone(this VRMBone bone) { #if UNITY_5_6_OR_NEWER if (bone == VRMBone.upperChest) { return(HumanBodyBones.LastBone); } #endif return(EnumUtil.TryParseOrDefault <HumanBodyBones>(bone.ToString(), HumanBodyBones.LastBone)); }
public static HumanBodyBones ToHumanBodyBone(this VRMBone bone) { #if UNITY_5_6_OR_NEWER #else if (bone == VRMBone.upperChest) { return(HumanBodyBones.LastBone); } #endif return(bone.ToUnityBone()); }
public static HumanBodyBones ToUnityBone(this VRMBone val) { switch (val) { case VRMBone.hips: return(HumanBodyBones.Hips); //"hips" case VRMBone.leftUpperLeg: return(HumanBodyBones.LeftUpperLeg); //"leftUpperLeg"; case VRMBone.rightUpperLeg: return(HumanBodyBones.RightUpperLeg); //"rightUpperLeg"; case VRMBone.leftLowerLeg: return(HumanBodyBones.LeftLowerLeg); //"leftLowerLeg"; case VRMBone.rightLowerLeg: return(HumanBodyBones.RightLowerLeg); //"rightLowerLeg"; case VRMBone.leftFoot: return(HumanBodyBones.LeftFoot); //"leftFoot"; case VRMBone.rightFoot: return(HumanBodyBones.RightFoot); //"rightFoot"; case VRMBone.spine: return(HumanBodyBones.Spine); //"spine"; case VRMBone.chest: return(HumanBodyBones.Chest); //"chest"; case VRMBone.neck: return(HumanBodyBones.Neck); //"neck"; case VRMBone.head: return(HumanBodyBones.Head); //"head"; case VRMBone.leftShoulder: return(HumanBodyBones.LeftShoulder); //"leftShoulder"; case VRMBone.rightShoulder: return(HumanBodyBones.RightShoulder); //"rightShoulder"; case VRMBone.leftUpperArm: return(HumanBodyBones.LeftUpperArm); //"leftUpperArm"; case VRMBone.rightUpperArm: return(HumanBodyBones.RightUpperArm); //"rightUpperArm"; case VRMBone.leftLowerArm: return(HumanBodyBones.LeftLowerArm); //"leftLowerArm"; case VRMBone.rightLowerArm: return(HumanBodyBones.RightLowerArm); //"rightLowerArm"; case VRMBone.leftHand: return(HumanBodyBones.LeftHand); //"leftHand"; case VRMBone.rightHand: return(HumanBodyBones.RightHand); //"rightHand"; case VRMBone.leftToes: return(HumanBodyBones.LeftToes); //"leftToes"; case VRMBone.rightToes: return(HumanBodyBones.RightToes); //"rightToes"; case VRMBone.leftEye: return(HumanBodyBones.LeftEye); //"leftEye"; case VRMBone.rightEye: return(HumanBodyBones.RightEye); //"rightEye"; case VRMBone.jaw: return(HumanBodyBones.Jaw); //"jaw"; case VRMBone.leftThumbProximal: return(HumanBodyBones.LeftThumbProximal); case VRMBone.leftThumbIntermediate: return(HumanBodyBones.LeftThumbIntermediate); case VRMBone.leftThumbDistal: return(HumanBodyBones.LeftThumbDistal); case VRMBone.leftIndexProximal: return(HumanBodyBones.LeftIndexProximal); case VRMBone.leftIndexIntermediate: return(HumanBodyBones.LeftIndexIntermediate); case VRMBone.leftIndexDistal: return(HumanBodyBones.LeftIndexDistal); case VRMBone.leftMiddleProximal: return(HumanBodyBones.LeftMiddleProximal); case VRMBone.leftMiddleIntermediate: return(HumanBodyBones.LeftMiddleIntermediate); case VRMBone.leftMiddleDistal: return(HumanBodyBones.LeftMiddleDistal); case VRMBone.leftRingProximal: return(HumanBodyBones.LeftRingProximal); case VRMBone.leftRingIntermediate: return(HumanBodyBones.LeftRingIntermediate); case VRMBone.leftRingDistal: return(HumanBodyBones.LeftRingDistal); case VRMBone.leftLittleProximal: return(HumanBodyBones.LeftLittleProximal); case VRMBone.leftLittleIntermediate: return(HumanBodyBones.LeftLittleIntermediate); case VRMBone.leftLittleDistal: return(HumanBodyBones.LeftLittleDistal); case VRMBone.rightThumbProximal: return(HumanBodyBones.RightThumbProximal); case VRMBone.rightThumbIntermediate: return(HumanBodyBones.RightThumbIntermediate); case VRMBone.rightThumbDistal: return(HumanBodyBones.RightThumbDistal); case VRMBone.rightIndexProximal: return(HumanBodyBones.RightIndexProximal); case VRMBone.rightIndexIntermediate: return(HumanBodyBones.RightIndexIntermediate); case VRMBone.rightIndexDistal: return(HumanBodyBones.RightIndexDistal); case VRMBone.rightMiddleProximal: return(HumanBodyBones.RightMiddleProximal); case VRMBone.rightMiddleIntermediate: return(HumanBodyBones.RightMiddleIntermediate); case VRMBone.rightMiddleDistal: return(HumanBodyBones.RightMiddleDistal); case VRMBone.rightRingProximal: return(HumanBodyBones.RightRingProximal); case VRMBone.rightRingIntermediate: return(HumanBodyBones.RightRingIntermediate); case VRMBone.rightRingDistal: return(HumanBodyBones.RightRingDistal); case VRMBone.rightLittleProximal: return(HumanBodyBones.RightLittleProximal); case VRMBone.rightLittleIntermediate: return(HumanBodyBones.RightLittleIntermediate); case VRMBone.rightLittleDistal: return(HumanBodyBones.RightLittleDistal); case VRMBone.upperChest: return(HumanBodyBones.UpperChest); default: throw new System.InvalidOperationException(); } }