From 7c6c6ef5353dda635571c1b196cdc18e92058fb5 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 7 Oct 2016 20:40:41 +0800 Subject: [PATCH] [csharp] Fixed path constraint bone sorting. Based on: https://github.com/EsotericSoftware/spine-runtimes/commit/c34db336d5bdaf5f623e44b0f607a1319fa2b470 --- spine-csharp/src/Skeleton.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spine-csharp/src/Skeleton.cs b/spine-csharp/src/Skeleton.cs index 37def244a..65e536ce8 100644 --- a/spine-csharp/src/Skeleton.cs +++ b/spine-csharp/src/Skeleton.cs @@ -224,9 +224,13 @@ namespace Spine { if (pathBones == null) SortBone(slotBone); else { - var bones = this.bones; - for (int i = 0, n = pathBones.Length; i < n; i++) - SortBone(bones.Items[pathBones[i]]); + var bonesItems = this.bones.Items; + for (int i = 0, n = pathBones.Length; i < n;) { + int nn = pathBones[i++]; + nn += i; + while (i < nn) + SortBone(bonesItems[pathBones[i++]]); + } } }