From 2d70e2b05ba58b845b0ef368ce9549e8f04723cf Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Mon, 3 Aug 2015 05:56:44 +0200 Subject: [PATCH] Fixed zSpacing. --- spine-unity/Assets/spine-unity/SkeletonRenderer.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spine-unity/Assets/spine-unity/SkeletonRenderer.cs b/spine-unity/Assets/spine-unity/SkeletonRenderer.cs index 386648209..368d1d82a 100644 --- a/spine-unity/Assets/spine-unity/SkeletonRenderer.cs +++ b/spine-unity/Assets/spine-unity/SkeletonRenderer.cs @@ -322,11 +322,16 @@ public class SkeletonRenderer : MonoBehaviour { Vector3 meshBoundsMin; meshBoundsMin.x = int.MaxValue; meshBoundsMin.y = int.MaxValue; - meshBoundsMin.z = zSpacing > 0f ? 0f : zSpacing * (drawOrderCount - 1); Vector3 meshBoundsMax; meshBoundsMax.x = int.MinValue; meshBoundsMax.y = int.MinValue; - meshBoundsMax.z = meshBoundsMin.z; + if (zSpacing > 0f) { + meshBoundsMin.z = 0f; + meshBoundsMax.z = zSpacing * (drawOrderCount - 1); + } else { + meshBoundsMin.z = zSpacing * (drawOrderCount - 1); + meshBoundsMax.z = 0f; + } for (int i = 0; i < drawOrderCount; i++) { Slot slot = drawOrder.Items[i]; Attachment attachment = slot.attachment;