Changing the material settings or using specific shaders, like the "Universal Render Pipeline/2D/Spine/Skeleton" shader, should not inherently break batching in Unity. However, there are several factors that could affect batching, such as changing properties that would cause the material to be considered unique per instance (e.g., changing colors or other material properties dynamically), or the complexity and setup of your skeletons.
Unity's batching system has specific requirements, and for Spine animations to be batched effectively, these requirements must be met. These include ensuring that the skeletons share the same material and texture atlas, and that the vertex count does not exceed Unity's batching limits. Additionally, the Universal Render Pipeline (URP) has its own considerations for batching, which might behave differently from the Standard Render Pipeline.
If you're experiencing issues with batching not working as expected, ensure that:
- All instances are using the same material and shader.
- You're not dynamically changing properties in a way that would make Unity consider each instance to require a separate draw call.
- Your skeletons are efficiently set up and do not exceed Unity's vertex count limit for batching.
For more detailed troubleshooting, consider reviewing Unity's documentation on batching and the specific requirements for the URP, as well as ensuring your Spine-Unity setup aligns with best practices for performance.