Browse Source

Updated SkeletonUtilityBone to handle FlipX better by scaling Z in follow mode when world flipped.

Fenrisul 10 years ago
parent
commit
366cbaf0c3

+ 3 - 1
spine-unity/Assets/spine-unity/SkeletonUtility/SkeletonUtilityBone.cs

@@ -172,7 +172,7 @@ public class SkeletonUtilityBone : MonoBehaviour {
 			}
 
 			if (scale) {
-				cachedTransform.localScale = new Vector3(bone.scaleX, bone.scaleY, 1);
+				cachedTransform.localScale = new Vector3(bone.scaleX, bone.scaleY, bone.worldFlipX ? -1 : 1);
 
 				nonUniformScaleWarning = (bone.scaleX != bone.scaleY);
 			}
@@ -206,6 +206,7 @@ public class SkeletonUtilityBone : MonoBehaviour {
 						}
 
 						bone.Rotation = angle;
+						bone.RotationIK = angle;
 					}
 
 					if (scale) {
@@ -245,6 +246,7 @@ public class SkeletonUtilityBone : MonoBehaviour {
 						}
 
 						bone.Rotation = angle;
+						bone.RotationIK = angle;
 					}
 
 					//TODO: Something about this