[haxe] Port of commit 64ed135: Fixed having a physics reset all timeline in a slider animation.

This commit is contained in:
Davide Tantillo 2025-10-01 10:40:57 +02:00
parent 9605df9737
commit 842c96a511
2 changed files with 7 additions and 3 deletions

View File

@ -117,8 +117,11 @@ class Slider extends Constraint<Slider, SliderData, SliderPose> {
skeleton.constrained(physics[ii]);
} else
skeleton.constrained(constraints[timeline.constraintIndex]);
} else if (Std.isOfType(t, ConstraintTimeline)) //
skeleton.constrained(constraints[cast(t, ConstraintTimeline).getConstraintIndex()]);
} else if (Std.isOfType(t, ConstraintTimeline)) {
var constraintIndex = cast(t, ConstraintTimeline).getConstraintIndex();
if (constraintIndex != -1)
skeleton.constrained(constraints[constraintIndex]);
}
}
}
}

View File

@ -30,6 +30,7 @@
package spine.animation;
interface ConstraintTimeline {
/** The index of the constraint in spine.Skeleton.constraints that will be changed when this timeline is applied. */
/** The index of the constraint in spine.Skeleton.constraints that will be changed when this timeline is applied, or
* -1 if a specific constraint will not be changed. */
public function getConstraintIndex():Int;
}