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/). 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 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