mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-05 02:06:53 +08:00
[libgdx] Don't apply slot timelines if the bone is not active or constraint timelines if the constraint is not active.
This commit is contained in:
parent
7bf732d3f8
commit
70cdf2dd9a
@ -707,6 +707,7 @@ public class Animation {
|
|||||||
MixDirection direction) {
|
MixDirection direction) {
|
||||||
|
|
||||||
Slot slot = skeleton.slots.get(slotIndex);
|
Slot slot = skeleton.slots.get(slotIndex);
|
||||||
|
if (!slot.bone.active) return;
|
||||||
float[] frames = this.frames;
|
float[] frames = this.frames;
|
||||||
if (time < frames[0]) { // Time is before first frame.
|
if (time < frames[0]) { // Time is before first frame.
|
||||||
switch (blend) {
|
switch (blend) {
|
||||||
@ -805,6 +806,7 @@ public class Animation {
|
|||||||
MixDirection direction) {
|
MixDirection direction) {
|
||||||
|
|
||||||
Slot slot = skeleton.slots.get(slotIndex);
|
Slot slot = skeleton.slots.get(slotIndex);
|
||||||
|
if (!slot.bone.active) return;
|
||||||
float[] frames = this.frames;
|
float[] frames = this.frames;
|
||||||
if (time < frames[0]) { // Time is before first frame.
|
if (time < frames[0]) { // Time is before first frame.
|
||||||
switch (blend) {
|
switch (blend) {
|
||||||
@ -918,6 +920,7 @@ public class Animation {
|
|||||||
MixDirection direction) {
|
MixDirection direction) {
|
||||||
|
|
||||||
Slot slot = skeleton.slots.get(slotIndex);
|
Slot slot = skeleton.slots.get(slotIndex);
|
||||||
|
if (!slot.bone.active) return;
|
||||||
if (direction == out && blend == setup) {
|
if (direction == out && blend == setup) {
|
||||||
String attachmentName = slot.data.attachmentName;
|
String attachmentName = slot.data.attachmentName;
|
||||||
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slotIndex, attachmentName));
|
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slotIndex, attachmentName));
|
||||||
@ -1001,6 +1004,7 @@ public class Animation {
|
|||||||
MixDirection direction) {
|
MixDirection direction) {
|
||||||
|
|
||||||
Slot slot = skeleton.slots.get(slotIndex);
|
Slot slot = skeleton.slots.get(slotIndex);
|
||||||
|
if (!slot.bone.active) return;
|
||||||
Attachment slotAttachment = slot.attachment;
|
Attachment slotAttachment = slot.attachment;
|
||||||
if (!(slotAttachment instanceof VertexAttachment) || !((VertexAttachment)slotAttachment).applyDeform(attachment)) return;
|
if (!(slotAttachment instanceof VertexAttachment) || !((VertexAttachment)slotAttachment).applyDeform(attachment)) return;
|
||||||
|
|
||||||
@ -1363,6 +1367,7 @@ public class Animation {
|
|||||||
MixDirection direction) {
|
MixDirection direction) {
|
||||||
|
|
||||||
IkConstraint constraint = skeleton.ikConstraints.get(ikConstraintIndex);
|
IkConstraint constraint = skeleton.ikConstraints.get(ikConstraintIndex);
|
||||||
|
if (!constraint.active) return;
|
||||||
float[] frames = this.frames;
|
float[] frames = this.frames;
|
||||||
if (time < frames[0]) { // Time is before first frame.
|
if (time < frames[0]) { // Time is before first frame.
|
||||||
switch (blend) {
|
switch (blend) {
|
||||||
@ -1479,6 +1484,7 @@ public class Animation {
|
|||||||
MixDirection direction) {
|
MixDirection direction) {
|
||||||
|
|
||||||
TransformConstraint constraint = skeleton.transformConstraints.get(transformConstraintIndex);
|
TransformConstraint constraint = skeleton.transformConstraints.get(transformConstraintIndex);
|
||||||
|
if (!constraint.active) return;
|
||||||
float[] frames = this.frames;
|
float[] frames = this.frames;
|
||||||
if (time < frames[0]) { // Time is before first frame.
|
if (time < frames[0]) { // Time is before first frame.
|
||||||
TransformConstraintData data = constraint.data;
|
TransformConstraintData data = constraint.data;
|
||||||
@ -1581,6 +1587,7 @@ public class Animation {
|
|||||||
MixDirection direction) {
|
MixDirection direction) {
|
||||||
|
|
||||||
PathConstraint constraint = skeleton.pathConstraints.get(pathConstraintIndex);
|
PathConstraint constraint = skeleton.pathConstraints.get(pathConstraintIndex);
|
||||||
|
if (!constraint.active) return;
|
||||||
float[] frames = this.frames;
|
float[] frames = this.frames;
|
||||||
if (time < frames[0]) { // Time is before first frame.
|
if (time < frames[0]) { // Time is before first frame.
|
||||||
switch (blend) {
|
switch (blend) {
|
||||||
@ -1627,6 +1634,7 @@ public class Animation {
|
|||||||
MixDirection direction) {
|
MixDirection direction) {
|
||||||
|
|
||||||
PathConstraint constraint = skeleton.pathConstraints.get(pathConstraintIndex);
|
PathConstraint constraint = skeleton.pathConstraints.get(pathConstraintIndex);
|
||||||
|
if (!constraint.active) return;
|
||||||
float[] frames = this.frames;
|
float[] frames = this.frames;
|
||||||
if (time < frames[0]) { // Time is before first frame.
|
if (time < frames[0]) { // Time is before first frame.
|
||||||
switch (blend) {
|
switch (blend) {
|
||||||
@ -1706,6 +1714,7 @@ public class Animation {
|
|||||||
MixDirection direction) {
|
MixDirection direction) {
|
||||||
|
|
||||||
PathConstraint constraint = skeleton.pathConstraints.get(pathConstraintIndex);
|
PathConstraint constraint = skeleton.pathConstraints.get(pathConstraintIndex);
|
||||||
|
if (!constraint.active) return;
|
||||||
float[] frames = this.frames;
|
float[] frames = this.frames;
|
||||||
if (time < frames[0]) { // Time is before first frame.
|
if (time < frames[0]) { // Time is before first frame.
|
||||||
switch (blend) {
|
switch (blend) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user