Forráskód Böngészése

[csharp] Fixed path constraint bone sorting.

Based on: https://github.com/EsotericSoftware/spine-runtimes/commit/c34db336d5bdaf5f623e44b0f607a1319fa2b470
John 9 éve
szülő
commit
7c6c6ef535
1 módosított fájl, 7 hozzáadás és 3 törlés
  1. 7 3
      spine-csharp/src/Skeleton.cs

+ 7 - 3
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++]]);
+				}
 			}
 		}