Hello!
First of all, I apoligize for my English.
I'm having troubles with spine and Unity. I have an exported spine file with its skeleton and atlas for our customizable avatar, and I have to "custom" the atlas regions, For example, I have "Hand A" in the atlas and I want to change it for "Robot Hand A" or "Monster Hand A". The thing is that with the latest version of Unity runtime our code doen't work anymore.
We can't use spine skins, we have to do it using the atlas regions because items use unity shaders.
Please find attached the code that used to work with the previous version:
// STEP 1: "EQUIP" ITEMS USING SPRITES
// STEP 1.1 Find the original/template attachment.
// Step 1.2 Get a clone of the original/template attachment.
// Step 1.3 Apply the Sprite image to the clone.
// Step 1.4 Add the remapped clone to the new custom skin.
// Let's do this for bodies
int bodiesSlotIndex = skeleton.FindSlotIndex(bodiesSlot); // You can access GetAttachment and SetAttachment via string, but caching the slotIndex is faster.
Attachment templateAttachment = templateSkin.GetAttachment(bodiesSlotIndex, bodiesKey); // STEP 1.1
Attachment newAttachment = templateAttachment.GetRemappedClone(bodiesSprite, sourceMaterial); // STEP 1.2 - 1.3
if (newAttachment != null) customSkin.SetAttachment(bodiesSlotIndex, bodiesKey, newAttachment); // STEP 1.4
We are trying to fix the code to keep the thing working but the "GetRemappedClone" doesn't exist anymore so the customizable avatar doesn't switch between sprites, allways show the default ones (the ones in the atlas)
Could you help me?
Thank you so much!
Best,
Asde