We recently pushed some changes to Spine-Unity that improved performance around 30% (varies from case to case). It's pretty new so I don't think a lot of people have switched to it yet/tested it thoroughly yet so we may find some bugs.
I just switched to it today and I found this.
This happens when I spawn my effects skeletons. These errors are really cryptic because they don't show a stacktrace.
But it says AABB all over the place so I figured it was the mesh bounds. I think the new manually-calculated mesh bounds don't account for the case when there are no visible attachments. Or it could be some other case.
Quick fix for now to anyone who encounters it is to look for this part of the code.:
Vector3 meshBoundsExtents = meshBoundsMax - meshBoundsMin;
Vector3 meshBoundsCenter = meshBoundsMin + meshBoundsExtents * 0.5f;
mesh.bounds = new Bounds(meshBoundsCenter, meshBoundsExtents);
And replace it with this:
// MANUAL MESH BOUNDS CALCULATION
if (vertexIndex > 0) {
Vector3 meshBoundsExtents = meshBoundsMax - meshBoundsMin;
Vector3 meshBoundsCenter = meshBoundsMin + meshBoundsExtents * 0.5f;
mesh.bounds = new Bounds(meshBoundsCenter, meshBoundsExtents);
} else {
mesh.bounds = new Bounds(Vector3.zero, Vector3.zero);
}
EDIT:
SkeletonRenderer's internal meshBoundsMin
and meshBoundsMax
values are initialized with float.MinValue
and float.MaxValue
.
Skipping all the calculations in between as in the case of no renderable attachments, the values that come out are float.NegativeInfinity.
But at least I found that that was the problem.