mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Fixed bounds when there are no attachments to render.
This commit is contained in:
parent
2d70e2b05b
commit
9478db3d2d
@ -320,9 +320,13 @@ public class SkeletonRenderer : MonoBehaviour {
|
|||||||
float a = skeleton.a * 255, r = skeleton.r, g = skeleton.g, b = skeleton.b;
|
float a = skeleton.a * 255, r = skeleton.r, g = skeleton.g, b = skeleton.b;
|
||||||
|
|
||||||
Vector3 meshBoundsMin;
|
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.x = int.MaxValue;
|
||||||
meshBoundsMin.y = int.MaxValue;
|
meshBoundsMin.y = int.MaxValue;
|
||||||
Vector3 meshBoundsMax;
|
|
||||||
meshBoundsMax.x = int.MinValue;
|
meshBoundsMax.x = int.MinValue;
|
||||||
meshBoundsMax.y = int.MinValue;
|
meshBoundsMax.y = int.MinValue;
|
||||||
if (zSpacing > 0f) {
|
if (zSpacing > 0f) {
|
||||||
@ -332,7 +336,8 @@ public class SkeletonRenderer : MonoBehaviour {
|
|||||||
meshBoundsMin.z = zSpacing * (drawOrderCount - 1);
|
meshBoundsMin.z = zSpacing * (drawOrderCount - 1);
|
||||||
meshBoundsMax.z = 0f;
|
meshBoundsMax.z = 0f;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < drawOrderCount; i++) {
|
int i = 0;
|
||||||
|
do {
|
||||||
Slot slot = drawOrder.Items[i];
|
Slot slot = drawOrder.Items[i];
|
||||||
Attachment attachment = slot.attachment;
|
Attachment attachment = slot.attachment;
|
||||||
RegionAttachment regionAttachment = attachment as RegionAttachment;
|
RegionAttachment regionAttachment = attachment as RegionAttachment;
|
||||||
@ -487,6 +492,7 @@ public class SkeletonRenderer : MonoBehaviour {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} while (++i < drawOrderCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Double buffer mesh.
|
// Double buffer mesh.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user