From 77b5f36336084fb8a48035c87d463831d924311d Mon Sep 17 00:00:00 2001 From: ZimM Date: Thu, 26 Feb 2015 23:29:53 +0200 Subject: [PATCH] derp. forgot to revert Gizmo color. do not calculate alpha when using additive blending --- spine-unity/Assets/spine-unity/SkeletonRenderer.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spine-unity/Assets/spine-unity/SkeletonRenderer.cs b/spine-unity/Assets/spine-unity/SkeletonRenderer.cs index e24414531..883021ef9 100644 --- a/spine-unity/Assets/spine-unity/SkeletonRenderer.cs +++ b/spine-unity/Assets/spine-unity/SkeletonRenderer.cs @@ -286,12 +286,11 @@ public class SkeletonRenderer : MonoBehaviour { vertices[vertexIndex + 3].y = tempVertices[RegionAttachment.Y3]; vertices[vertexIndex + 3].z = z; - color.a = (byte)(a * slot.a * regionAttachment.a); + color.a = slot.data.additiveBlending ? (byte) 0 : (byte)(a * slot.a * regionAttachment.a); color.r = (byte)(r * slot.r * regionAttachment.r * color.a); color.g = (byte)(g * slot.g * regionAttachment.g * color.a); color.b = (byte)(b * slot.b * regionAttachment.b * color.a); - if (slot.data.additiveBlending) - color.a = 0; + colors[vertexIndex] = color; colors[vertexIndex + 1] = color; colors[vertexIndex + 2] = color; @@ -589,7 +588,7 @@ public class SkeletonRenderer : MonoBehaviour { if (mesh == null) return; Bounds meshBounds = mesh.bounds; - Gizmos.color = Color.red; + Gizmos.color = Color.clear; Gizmos.matrix = transform.localToWorldMatrix; Gizmos.DrawCube(meshBounds.center, meshBounds.size); }