mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
[unity] Skip SkeletonUtility follow post-local phase if bones are not constrained.
This commit is contained in:
parent
9e89e37c54
commit
1d5b62c2fd
@ -142,24 +142,25 @@ namespace Spine.Unity {
|
|||||||
break;
|
break;
|
||||||
case UpdatePhase.World:
|
case UpdatePhase.World:
|
||||||
case UpdatePhase.Complete:
|
case UpdatePhase.Complete:
|
||||||
// Use Applied transform values (ax, ay, AppliedRotation, ascale) because world values may be modified by constraints.
|
// Use Applied transform values (ax, ay, AppliedRotation, ascale) if world values were modified by constraints.
|
||||||
bone.UpdateAppliedTransform();
|
if (!bone.appliedValid) {
|
||||||
|
bone.UpdateAppliedTransform();
|
||||||
|
if (position)
|
||||||
|
thisTransform.localPosition = new Vector3(bone.ax, bone.ay, 0);
|
||||||
|
|
||||||
if (position)
|
if (rotation) {
|
||||||
thisTransform.localPosition = new Vector3(bone.ax, bone.ay, 0);
|
if (bone.data.transformMode.InheritsRotation()) {
|
||||||
|
thisTransform.localRotation = Quaternion.Euler(0, 0, bone.AppliedRotation);
|
||||||
if (rotation) {
|
} else {
|
||||||
if (bone.data.transformMode.InheritsRotation()) {
|
Vector3 euler = skeletonTransform.rotation.eulerAngles;
|
||||||
thisTransform.localRotation = Quaternion.Euler(0, 0, bone.AppliedRotation);
|
thisTransform.rotation = Quaternion.Euler(euler.x, euler.y, euler.z + (bone.WorldRotationX * skeletonFlipRotation));
|
||||||
} else {
|
}
|
||||||
Vector3 euler = skeletonTransform.rotation.eulerAngles;
|
|
||||||
thisTransform.rotation = Quaternion.Euler(euler.x, euler.y, euler.z + (bone.WorldRotationX * skeletonFlipRotation));
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (scale) {
|
if (scale) {
|
||||||
thisTransform.localScale = new Vector3(bone.ascaleX, bone.ascaleY, 1f);
|
thisTransform.localScale = new Vector3(bone.ascaleX, bone.ascaleY, 1f);
|
||||||
incompatibleTransformMode = BoneTransformModeIncompatible(bone);
|
incompatibleTransformMode = BoneTransformModeIncompatible(bone);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user