From 17ba6e2354989473c74eddf5ae55dac6a572d10a Mon Sep 17 00:00:00 2001 From: John Date: Tue, 29 Mar 2016 05:03:43 +0800 Subject: [PATCH] Don't mix from uninitialized slot vertices. --- spine-csharp/src/Animation.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spine-csharp/src/Animation.cs b/spine-csharp/src/Animation.cs index 47828f8af..6af01ddf7 100644 --- a/spine-csharp/src/Animation.cs +++ b/spine-csharp/src/Animation.cs @@ -582,11 +582,14 @@ namespace Spine { int vertexCount = frameVertices[0].Length; float[] vertices = slot.attachmentVertices; + + // Don't mix from uninitialized slot vertices. + if (slot.attachmentVerticesCount == 0 || vertices.Length != vertexCount) alpha = 1; + if (vertices.Length < vertexCount) { vertices = new float[vertexCount]; slot.attachmentVertices = vertices; } - if (vertices.Length != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices. slot.attachmentVerticesCount = vertexCount; if (time >= frames[frames.Length - 1]) { // Time is after last frame.