From f695cf19c241d876550bd001b7cbf64a2b1f4400 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 9 May 2016 03:18:07 +0800 Subject: [PATCH 1/2] [Unity] Fixed no renderables causing errors. --- .../Assets/spine-unity/SkeletonRenderer.cs | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/spine-unity/Assets/spine-unity/SkeletonRenderer.cs b/spine-unity/Assets/spine-unity/SkeletonRenderer.cs index 2c9afe39e..9cf65b806 100644 --- a/spine-unity/Assets/spine-unity/SkeletonRenderer.cs +++ b/spine-unity/Assets/spine-unity/SkeletonRenderer.cs @@ -344,18 +344,20 @@ namespace Spine.Unity { submeshVertexCount += attachmentVertexCount; } - workingSubmeshInstructions.Add( - new Spine.Unity.MeshGeneration.SubmeshInstruction { - skeleton = this.skeleton, - material = lastMaterial, - startSlot = submeshStartSlotIndex, - endSlot = drawOrderCount, - triangleCount = submeshTriangleCount, - firstVertexIndex = submeshFirstVertex, - vertexCount = submeshVertexCount, - forceSeparate = false - } - ); + if (submeshVertexCount != 0) { + workingSubmeshInstructions.Add( + new Spine.Unity.MeshGeneration.SubmeshInstruction { + skeleton = this.skeleton, + material = lastMaterial, + startSlot = submeshStartSlotIndex, + endSlot = drawOrderCount, + triangleCount = submeshTriangleCount, + firstVertexIndex = submeshFirstVertex, + vertexCount = submeshVertexCount, + forceSeparate = false + } + ); + } workingInstruction.vertexCount = vertexCount; workingInstruction.immutableTriangles = this.immutableTriangles; @@ -1009,4 +1011,4 @@ namespace Spine.Unity { public int firstVertex = -1; } } -} \ No newline at end of file +} From 16e900934ff14937a856c7d20c98dfde13da6bbf Mon Sep 17 00:00:00 2001 From: "qinghong.sheng" <464165202@qq.com> Date: Tue, 10 May 2016 18:48:02 +0800 Subject: [PATCH 2/2] fix a mistake (#566) * fix a mistake * fix a mistake --- spine-js/spine.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spine-js/spine.js b/spine-js/spine.js index 06499bc56..cb819142c 100644 --- a/spine-js/spine.js +++ b/spine-js/spine.js @@ -399,7 +399,7 @@ spine.IkConstraint.apply2 = function (parent, child, targetX, targetY, bendDir, if (cos < -1) cos = -1; else if (cos > 1) cos = 1; a2 = Math.acos(cos) * bendDir; - var a = l1 + l2 * cos, o = l2 * sin(a2); + var a = l1 + l2 * cos, o = l2 * Math.sin(a2); a1 = Math.atan2(ty * a - tx * o, tx * a + ty * o); } else { var a = psx * l2, b = psy * l2, ta = Math.atan2(ty, tx); @@ -459,8 +459,8 @@ spine.IkConstraint.apply2 = function (parent, child, targetX, targetY, bendDir, } } var os = Math.atan2(cy, cx) * s2; - a1 = (a1 - os) * radDeg + os1; - a2 = (a2 + os) * radDeg * s2 + os2; + a1 = (a1 - os) * spine.radDeg + os1; + a2 = (a2 + os) * spine.radDeg * s2 + os2; if (a1 > 180) a1 -= 360; else if (a1 < -180) a1 += 360; if (a2 > 180) a2 -= 360; @@ -2856,4 +2856,4 @@ spine.SkeletonBounds.prototype = { getHeight: function () { return this.maxY - this.minY; } -}; \ No newline at end of file +};