From 696c723013c394ea76be4b6295a569f35d78d707 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Wed, 13 Jul 2022 20:34:17 +0200 Subject: [PATCH] [Unity] Now really fixed SkeletonRootMotion out of bounds access when selecting non-default Root Motion Bone with a TransformConstraint. See #2110. --- .../spine-unity/Components/RootMotion/SkeletonRootMotionBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotionBase.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotionBase.cs index 24b7e5955..248aa1ccf 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotionBase.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/RootMotion/SkeletonRootMotionBase.cs @@ -443,7 +443,7 @@ namespace Spine.Unity { int GetConstraintLastPosIndex (int constraintIndex) { var constraints = skeletonComponent.Skeleton.TransformConstraints; TransformConstraint targetConstraint = constraints.Items[constraintIndex]; - return constraints.FindIndex(constraint => constraint == targetConstraint); + return transformConstraintIndices.FindIndex(addedIndex => addedIndex == constraintIndex); } void FindTransformConstraintsAffectingBone () {