https://docs.unity3d.com/Documentation/ ... sible.html
It doesn't say when isVisible
returns true. Probably it uses the mesh's bounds, but we can only guess. For some reason, Unity seems to use the initial bounds of the mesh for culling purposes. If the skeleton is animated and much larger later, the bounds don't seem to increase in size, even though we call mesh.RecalculateBounds()
. :tmi:
There is another problem with using the mesh bounds to avoid updating the skeleton and mesh unnecessarily. If updating the skeleton would make the bounds bigger, then you may avoid updating the skeleton when it should be visible. :bang:
You can see this in the spineboy example for spine-unity. Move him down so only his head is visible and put if (!renderer.isVisible) return;
in SkeletonRenderer#LateUpdate. Spineboy will never render. Because his center (0,0) is off screen, the skeleton and mesh are never updated. A better check would be:
if (submeshMaterials.Count > 0 && !renderer.isVisible) return;
This causes the mesh to be updated at least once. However, if you move spineboy down, just off screen, then when he jumps he won't be visible.
Any ideas with how to make this work with Unity would be great. :smoke: