瀏覽代碼

[unity] Fix SkeletonUtility not following IK bone positions.

pharan 6 年之前
父節點
當前提交
5ab16f6ba7
共有 1 個文件被更改,包括 15 次插入14 次删除
  1. 15 14
      spine-unity/Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityBone.cs

+ 15 - 14
spine-unity/Assets/Spine/Runtime/spine-unity/SkeletonUtility/SkeletonUtilityBone.cs

@@ -141,23 +141,24 @@ namespace Spine.Unity {
 						// Use Applied transform values (ax, ay, AppliedRotation, ascale) if world values were modified by constraints.
 						// Use Applied transform values (ax, ay, AppliedRotation, ascale) if world values were modified by constraints.
 						if (!bone.appliedValid) {
 						if (!bone.appliedValid) {
 							bone.UpdateAppliedTransform();
 							bone.UpdateAppliedTransform();
-							if (position)
-								thisTransform.localPosition = new Vector3(bone.ax, bone.ay, 0);
-
-							if (rotation) {
-								if (bone.data.transformMode.InheritsRotation()) {
-									thisTransform.localRotation = Quaternion.Euler(0, 0, bone.AppliedRotation);
-								} else {
-									Vector3 euler = skeletonTransform.rotation.eulerAngles;
-									thisTransform.rotation = Quaternion.Euler(euler.x, euler.y, euler.z + (bone.WorldRotationX * skeletonFlipRotation));
-								}
-							}
+						}
+
+						if (position)
+							thisTransform.localPosition = new Vector3(bone.ax, bone.ay, 0);
 
 
-							if (scale) {
-								thisTransform.localScale = new Vector3(bone.ascaleX, bone.ascaleY, 1f);
-								incompatibleTransformMode = BoneTransformModeIncompatible(bone);
+						if (rotation) {
+							if (bone.data.transformMode.InheritsRotation()) {
+								thisTransform.localRotation = Quaternion.Euler(0, 0, bone.AppliedRotation);
+							} else {
+								Vector3 euler = skeletonTransform.rotation.eulerAngles;
+								thisTransform.rotation = Quaternion.Euler(euler.x, euler.y, euler.z + (bone.WorldRotationX * skeletonFlipRotation));
 							}
 							}
 						}
 						}
+
+						if (scale) {
+							thisTransform.localScale = new Vector3(bone.ascaleX, bone.ascaleY, 1f);
+							incompatibleTransformMode = BoneTransformModeIncompatible(bone);
+						}
 						break;
 						break;
 				}
 				}