Hello, I'm using Unity. I have a skeleton with multiple skin attached:
In spine, we have some skin, named "humanoid", "eye", "mouth", "armor 3000"
And In unity: I made a script who add on the skeleton every skin I want with skin.Append
It works well, I do that for changing in real time the materials of the skins: I made a procedural humanoid generator, and like that, I can change realy quickly the sprite of the materials eye, mouth, etc.
But... there is a but. you see this array of materials in the MeshRenderer:
the (instance) in the name means that I'm the one who's changed the meshRenderer.materials, in hard code
My goal was to clone the shared materials, like that, I can have multiple skeleton with different clonned materials.
I did something like meshRenderer.materials = CloneActualMaterials(meshRenderer.materials);
So now it works... BUT, when i have in spine an Animation who create a particle effect, or a SWOUCH or something, the
if (rendererBuffers.MaterialsChangedInLastUpdate()) is called (in SkeletonRenderer.cs,, line 32X), and then you do:
meshRenderer.sharedMaterials = rendererBuffers.GetUpdatedSharedMaterialsArray();
And all my cloned materials are changed with old shared mat:
So... What can I do ?
Maybe when i'm clonning the materials in the meshRenrered, I have to call MeshRendererBuffers.UpdateSharedMaterials() with the new clonned one... BUT how do I acces this function via the SkeletonAnimation script ?
Thanks you, I hope you understand, and you can help us.