gdh22

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


1.JPG
У вас нет необходимых прав для просмотра вложений в этом сообщении.
gdh22
  • Сообщения: 5

Harald

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.
Аватара пользователя
Harald

Harri
  • Сообщения: 1105

Wecica

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.
Wecica
  • Сообщения: 7

Harald

Thanks @Wecica for chiming in on the subject. I wonder why I haven't suggested this as well back then.. :think:
Аватара пользователя
Harald

Harri
  • Сообщения: 1105

Wecica

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:
Wecica
  • Сообщения: 7

Harald

:D Still thanks very much for taking the time and effort! Knowing which words to copy for which circumstance is still honorable! :nerd:
Аватара пользователя
Harald

Harri
  • Сообщения: 1105


Вернуться в Unity