Browse Source

[unity] Fixed a bug in SkeletonGraphic when submesh instructions are empty and clipping is active.

Harald Csaszar 5 years ago
parent
commit
41f9aeac18

+ 1 - 1
spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs

@@ -332,7 +332,7 @@ namespace Spine.Unity {
 			bool updateTriangles = SkeletonRendererInstruction.GeometryNotEqual(currentInstructions, smartMesh.instructionUsed);
 
 			meshGenerator.Begin();
-			if (currentInstructions.hasActiveClipping) {
+			if (currentInstructions.hasActiveClipping && currentInstructions.submeshInstructions.Count > 0) {
 				meshGenerator.AddSubmesh(currentInstructions.submeshInstructions.Items[0], updateTriangles);
 			} else {
 				meshGenerator.BuildMeshWithArrays(currentInstructions, updateTriangles);