From b4097aa5859b8fa267ebd6d5857d69a00c492be9 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Sat, 7 Apr 2018 18:18:44 +0900 Subject: [PATCH] exclude upperChest for Unity-5.5 --- Scripts/Format/glTF_VRM_Humanoid.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Scripts/Format/glTF_VRM_Humanoid.cs b/Scripts/Format/glTF_VRM_Humanoid.cs index f73bf1b38..f9510cc51 100644 --- a/Scripts/Format/glTF_VRM_Humanoid.cs +++ b/Scripts/Format/glTF_VRM_Humanoid.cs @@ -75,7 +75,18 @@ namespace VRM } public static HumanBodyBones ToHumanBodyBone(this VRMBone bone) { +#if UNITY_5_6_OR_NEWER return EnumUtil.TryParseOrDefault(bone.ToString()); +#else + if (bone == VRMBone.upperChest) + { + return HumanBodyBones.LastBone; + } + else + { + return EnumUtil.TryParseOrDefault(bone.ToString()); + } +#endif } } @@ -214,7 +225,9 @@ namespace VRM min = x.min, max = x.max, humanBone = x.vrmBone.ToHumanBodyBone(), - }).ToArray(); + }) + .Where(x => x.humanBone!= HumanBodyBones.LastBone) + .ToArray(); return description; } }