Hello.
I am going to replace the weapon.
No problem when using normal skeleton.
With SkeletonGraphic, the image is broken like a photo.
I would appreciate it if you could tell me the solution.
thank you.
my code:
Spine.Skin customSkin = skeletonGraphic.Skeleton.Skin ?? new Spine.Skin("WPChangeSkin");
int index = skeletonGraphic.Skeleton.FindSlotIndex(PlayerSpineData.weaponSlotName);
if (0 < index)
{
Material newMat = new Material(Shader.Find("UI/Default"));
Spine.Attachment attachment = skeletonGraphic.Skeleton.GetAttachment(index, PlayerSpineData.weaponSlotName);
var newAtt = attachment.GetRemappedClone(sprite, newMat);
customSkin.SetAttachment(index, PlayerSpineData.weaponSlotName, newAtt);
skeletonGraphic.Skeleton.SetSkin(customSkin);
skeletonGraphic.Skeleton.SetSlotsToSetupPose();
skeletonGraphic.LateUpdate();
}