[unity] BoneFollower. Negate rotation from negative scaleX.

This commit is contained in:
John 2018-01-09 17:26:11 +08:00 committed by GitHub
parent 92cacd7e6d
commit c2dea9f9fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,6 +163,7 @@ namespace Spine.Unity {
if (followBoneRotation) {
Vector3 worldRotation = skeletonTransform.rotation.eulerAngles;
if (followLocalScale && bone.scaleX < 0) boneWorldRotation += 180f;
#if UNITY_5_6_OR_NEWER
thisTransform.SetPositionAndRotation(targetWorldPosition, Quaternion.Euler(worldRotation.x, worldRotation.y, skeletonTransform.rotation.eulerAngles.z + boneWorldRotation));
#else