Problem Description
I'm having an issue with Spine's SkeletonMecanim component in Unity. I implemented a "Create Unique Material Instance" option to allow each Spine object to use its own material instance, but the original material is still being used despite checking this option. It seems like SkeletonMecanim or SkeletonRenderer is forcefully overwriting my material instance during each update cycle.
Details
The issue occurs when trying to create a unique material instance for a Spine skeleton to modify its properties individually
Each frame, the original shared material is being reapplied, overriding any changes I make to the instance
I've found that SkeletonRenderer.LateUpdateMesh() calls meshRenderer.sharedMaterials = rendererBuffers.GetUpdatedSharedMaterialsArray() which seems to be overwriting the custom material instance
Questions
What would happen if I disable SkeletonMecanim component? Would it affect gameplay or animation behavior?
Are there any known side effects of modifying Spine materials at runtime?
Why does the original SkeletonMecanim implementation force a specific material to be used? Is this intentional for performance reasons or something else?
Is there an official way to create unique material instances for Spine objects without modifying the source code?
My Current Solution
I've modified the SkeletonMecanim class to override the LateUpdateMesh method and re-apply my material instance after the base implementation runs. It seems to work but I'd prefer to understand if there's a more proper way to achieve this or if there are any risks with this approach.
Any insights or official solutions would be greatly appreciated.****