mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Fix SkeletonUtility not following IK bone positions.
This commit is contained in:
parent
0fa7633ad1
commit
e63a75e9e9
@ -143,25 +143,25 @@ namespace Spine.Unity {
|
|||||||
case UpdatePhase.World:
|
case UpdatePhase.World:
|
||||||
case UpdatePhase.Complete:
|
case UpdatePhase.Complete:
|
||||||
// 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 (position)
|
||||||
if (bone.data.transformMode.InheritsRotation()) {
|
thisTransform.localPosition = new Vector3(bone.ax, bone.ay, 0);
|
||||||
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) {
|
if (rotation) {
|
||||||
thisTransform.localScale = new Vector3(bone.ascaleX, bone.ascaleY, 1f);
|
if (bone.data.transformMode.InheritsRotation()) {
|
||||||
incompatibleTransformMode = BoneTransformModeIncompatible(bone);
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user