• Unity
  • hello. Image is broken when skin is replaced.

  • Изменено
Related Discussions
...

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();
                }

Which version of the Spine-Unity runtime are you using (name of the unitypackage)? We have just recently fixed two issues related to skins and SkeletonGraphic, so if you are not yet using the latest 3.8 package spine-unity-3.8-2019-08-20.unitypackage, please consider updating.

2 месяца спустя

SkeletonGraphic has the limitation of a single material, you need to be sure that everything ends up in a single atlas page including clothes and weapons.

Thanks @Wecica for chiming in on the subject. I wonder why I haven't suggested this as well back then.. :think:

20 дней спустя
Harald написал

Thanks @Wecica for chiming in on the subject. I wonder why I haven't suggested this as well back then.. :think:

Not at all, I just copy your words from another post... :smirk:

😃 Still thanks very much for taking the time and effort! Knowing which words to copy for which circumstance is still honorable! :nerd: