Using Spine for UI and backgrounds can indeed be beneficial, especially for creating rich, animated interfaces that engage artists. However, as you mentioned, having a significant number of slots can impact optimization, particularly in terms of draw calls and memory usage.
Here are some recommendations to mitigate these issues:
Texture Atlases: Combine multiple images into a single texture atlas. This reduces the number of draw calls by ensuring that multiple slots can be rendered in a single draw call. You can use the Spine Texture Packer to create these atlases.
Runtime Repacking: For dynamic content, consider repacking atlases at runtime. This allows you to combine only the images currently needed, reducing memory usage and draw calls. The spine-unity runtime provides examples like "Mix and Match" that demonstrate how to do this.
Efficient Use of Slots: Minimize the number of slots by reusing them where possible. For instance, if multiple elements share the same animation or visual properties, they can be combined into a single slot.
Batching: Ensure that your images are packed into a single atlas page to enable dynamic batching. This can significantly reduce draw calls if the general batching requirements are met (e.g., vertex count).
Performance Testing: Always test on your target devices to ensure that performance is acceptable. This is crucial as different devices may handle the load differently.
Skeleton Draw Order: Manage the draw order of skeletons to optimize rendering. This can be done by controlling which skeletons are drawn on top of others.
For more detailed information, you can refer to the following resources:
By following these practices, you can leverage Spine's capabilities for UI and backgrounds while maintaining optimal performance.