[Unity] Now really fixed SkeletonRootMotion out of bounds access when selecting non-default Root Motion Bone with a TransformConstraint. See #2110.

This commit is contained in:
Harald Csaszar 2022-07-13 20:34:17 +02:00
parent 2ef38e4f01
commit 696c723013

View File

@ -443,7 +443,7 @@ namespace Spine.Unity {
int GetConstraintLastPosIndex (int constraintIndex) { int GetConstraintLastPosIndex (int constraintIndex) {
var constraints = skeletonComponent.Skeleton.TransformConstraints; var constraints = skeletonComponent.Skeleton.TransformConstraints;
TransformConstraint targetConstraint = constraints.Items[constraintIndex]; TransformConstraint targetConstraint = constraints.Items[constraintIndex];
return constraints.FindIndex(constraint => constraint == targetConstraint); return transformConstraintIndices.FindIndex(addedIndex => addedIndex == constraintIndex);
} }
void FindTransformConstraintsAffectingBone () { void FindTransformConstraintsAffectingBone () {