Misaki No. This skeleton data does not have multiple atlas pages. I can upload the files.
This is my code:
Skeleton skeleton = m_Spine.Skeleton;
SkeletonData skeletonData = skeleton.Data;
Material sourceMaterial = m_Spine.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial;
// 当前的skin作为模板
Skin templateSkin = skeletonData.FindSkin("1");
Skin currentEquipsSkin = new Skin("my custom skin");
currentEquipsSkin.AddSkin(templateSkin);
Slot slot = skeleton.FindSlot("pic");
int slotIndex = skeleton.Slots.IndexOf(slot);
Attachment attachment = templateSkin.GetAttachment(slotIndex, "pic");
Attachment newAttachment = attachment.GetRemappedClone(m_CardSprite, sourceMaterial);
currentEquipsSkin.SetAttachment(slotIndex, "pic", newAttachment);
// 重新设置图片(Graphic下必须)
currentEquipsSkin = currentEquipsSkin.GetRepackedSkin("repacked skin", sourceMaterial,
out Material runtimeMaterial, out Texture2D runtimeAtlas);
// 储存skin
skeleton.SetSkin(currentEquipsSkin);
skeleton.SetSlotsToSetupPose();
m_Spine.Update(0);