Fixed bounds when there are no attachments to render.

This commit is contained in:
NathanSweet 2015-08-03 14:15:14 +02:00
parent 2d70e2b05b
commit 9478db3d2d

View File

@ -320,9 +320,13 @@ public class SkeletonRenderer : MonoBehaviour {
float a = skeleton.a * 255, r = skeleton.r, g = skeleton.g, b = skeleton.b;
Vector3 meshBoundsMin;
Vector3 meshBoundsMax;
if (vertexCount == 0) {
meshBoundsMin = new Vector3(0, 0, 0);
meshBoundsMax = new Vector3(0, 0, 0);
} else {
meshBoundsMin.x = int.MaxValue;
meshBoundsMin.y = int.MaxValue;
Vector3 meshBoundsMax;
meshBoundsMax.x = int.MinValue;
meshBoundsMax.y = int.MinValue;
if (zSpacing > 0f) {
@ -332,7 +336,8 @@ public class SkeletonRenderer : MonoBehaviour {
meshBoundsMin.z = zSpacing * (drawOrderCount - 1);
meshBoundsMax.z = 0f;
}
for (int i = 0; i < drawOrderCount; i++) {
int i = 0;
do {
Slot slot = drawOrder.Items[i];
Attachment attachment = slot.attachment;
RegionAttachment regionAttachment = attachment as RegionAttachment;
@ -487,6 +492,7 @@ public class SkeletonRenderer : MonoBehaviour {
}
}
}
} while (++i < drawOrderCount);
}
// Double buffer mesh.