From f14e898d2d6a9da0f8cd4df0c8f1ad6ef27ddbb5 Mon Sep 17 00:00:00 2001 From: pharan Date: Tue, 19 Apr 2016 05:45:10 +0800 Subject: [PATCH 1/3] [Unity] Fix extra renderers check. --- .../SkeletonRenderSeparator.cs | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/spine-unity/Assets/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.cs b/spine-unity/Assets/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.cs index 6852f7a77..e56b84732 100644 --- a/spine-unity/Assets/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.cs +++ b/spine-unity/Assets/spine-unity/Modules/SkeletonRenderSeparator/SkeletonRenderSeparator.cs @@ -119,16 +119,16 @@ namespace Spine.Unity.Modules { int lastSubmeshInstruction = submeshInstructions.Count - 1; var currentRenderer = partsRenderers[rendererIndex]; - bool skeletonRendererCalculateNormals = skeletonRenderer.calculateNormals; + bool useNormals = skeletonRenderer.calculateNormals; - for (int i = 0, start = 0; i <= lastSubmeshInstruction; i++) { - if (submeshInstructionsItems[i].forceSeparate) { - currentRenderer.RenderParts(instruction.submeshInstructions, start, i + 1); - currentRenderer.MeshGenerator.GenerateNormals = skeletonRendererCalculateNormals; + for (int si = 0, start = 0; si <= lastSubmeshInstruction; si++) { + if (submeshInstructionsItems[si].forceSeparate || si == lastSubmeshInstruction) { + currentRenderer.RenderParts(instruction.submeshInstructions, start, si + 1); + currentRenderer.MeshGenerator.GenerateNormals = useNormals; if (copyPropertyBlock) currentRenderer.SetPropertyBlock(block); - start = i + 1; + start = si + 1; rendererIndex++; if (rendererIndex < rendererCount) { currentRenderer = partsRenderers[rendererIndex]; @@ -136,26 +136,15 @@ namespace Spine.Unity.Modules { // Not enough renderers. Skip the rest of the instructions. break; } - } else if (i == lastSubmeshInstruction) { - currentRenderer.RenderParts(instruction.submeshInstructions, start, i + 1); - currentRenderer.MeshGenerator.GenerateNormals = skeletonRendererCalculateNormals; - if (copyPropertyBlock) - currentRenderer.SetPropertyBlock(block); } } - - // If too many renderers. Clear the rest. - rendererIndex++; - if (rendererIndex < rendererCount - 1) { - for (int i = rendererIndex; i < rendererCount; i++) { - currentRenderer = partsRenderers[i]; - currentRenderer.ClearMesh(); - } + + // Clear extra renderers if they exist. + for (; rendererIndex < rendererCount; rendererIndex++) { + partsRenderers[rendererIndex].ClearMesh(); } } - - } } \ No newline at end of file From be4e99bd47ee6a3e7887b495361a3e42ca586482 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 19 Apr 2016 12:54:15 +0800 Subject: [PATCH 2/3] Link to new 2D Toolkit website. --- spine-unity/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-unity/README.md b/spine-unity/README.md index 0e1fd4df1..465178b58 100644 --- a/spine-unity/README.md +++ b/spine-unity/README.md @@ -4,7 +4,7 @@ The **spine-unity** runtime provides functionality to load, manipulate and rende For more documentation, see [spine-unity Documentation](https://github.com/pharan/spine-unity-docs/blob/master/README.md). -While spine-unity can render directly with Unity, without the need for any other plugins, it also works with [2D Toolkit](http://www.unikronsoftware.com/2dtoolkit/) and can render skeletons using a TK2D texture atlas. +While spine-unity can render directly with Unity, without the need for any other plugins, it also works with [2D Toolkit](http://www.2dtoolkit.com/) and can render skeletons using a TK2D texture atlas. ## Licensing From e360d08d5e1c0276a59bcb8fb39b571bff45ee4e Mon Sep 17 00:00:00 2001 From: John Date: Tue, 19 Apr 2016 12:55:12 +0800 Subject: [PATCH 3/3] Link to new 2D Toolkit website. --- spine-tk2d/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-tk2d/README.md b/spine-tk2d/README.md index 40832c297..46e932de2 100644 --- a/spine-tk2d/README.md +++ b/spine-tk2d/README.md @@ -1,3 +1,3 @@ # spine-tk2d -The spine-tk2d runtime has been merged into [spine-unity](https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-unity). You may use spine-unity with [2D Toolkit](http://www.unikronsoftware.com/2dtoolkit/). +The spine-tk2d runtime has been merged into [spine-unity](https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-unity). You may use spine-unity with [2D Toolkit](http://www.2dtoolkit.com/).