steph

Hello, I have a question about a library.
So there you go, I'm using the runtime for monogame C #. I already use the skins to have different characters and in my game to be able to give the choice between the male and female character.

(Like image)

Everything works fine with the skins.

Now I would like to put an item in the character's hands (Here in the picture a shovel), regardless of the female or male skin. I have a lot of things to put on, about thirty. How can I change the texture (for exmple, an ax or any other object) of the object in the character's hands with my two skins? I would love to do this directly in C # code too.
Hope you understood me.

Steph. Thank you
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
steph
  • Mesajlar: 7

Harald

You can either make your items skins as well (which makes sense for e.g. armor items or trousers that are composed of multiple attachments attached to multiple bones), using runtime code as described here:
spine-unity Runtime Documentation: Combining Skins

If you want to attach only a single image such as a weapon, you can directly set a Slot's attachment via slot = skeleton.FindSlot(); slot.Attachment = attachment; (see Skeleton findSlot and Slot attachment ),
or via convenience methods like skeleton.SetAttachment(slotName, attachmentName) (see Skeleton setAttachment).

If you are already creating a combined skin programmatically, you can also set the attachment at this combined skin via combinedSkin.SetAttachment() (see Skin setAttachment).
Kullanıcı avatarı
Harald

Harri
  • Mesajlar: 3905

Mario

I strongly recommend using skins for weapons as well. While it's possible to do it all in code, it's messy and may also bring issues with texture atlas packaging and hence performance.
Kullanıcı avatarı
Mario

Mario
  • Mesajlar: 2965

steph

Great ! I didn't know we could do this. Thank you very much !

---

Mario yazdı:I strongly recommend using skins for weapons as well. While it's possible to do it all in code, it's messy and may also bring issues with texture atlas packaging and hence performance.
Ok thank for the tip

---

Harald yazdı:You can either make your items skins as well (which makes sense for e.g. armor items or trousers that are composed of multiple attachments attached to multiple bones), using runtime code as described here:
spine-unity Runtime Documentation: Combining Skins

If you want to attach only a single image such as a weapon, you can directly set a Slot's attachment via slot = skeleton.FindSlot(); slot.Attachment = attachment; (see Skeleton findSlot and Slot attachment ),
or via convenience methods like skeleton.SetAttachment(slotName, attachmentName) (see Skeleton setAttachment).

If you are already creating a combined skin programmatically, you can also set the attachment at this combined skin via combinedSkin.SetAttachment() (see Skin setAttachment).
One last question, I can't find out how to display multiple skins in spine?
I have to create additional skins for my tools but I can't find how to display my characters and my tools at the same time.
steph
  • Mesajlar: 7

Erika

steph yazdı:One last question, I can't find out how to display multiple skins in spine?
I have to create additional skins for my tools but I can't find how to display my characters and my tools at the same time.
You can do so by opening the skins view, then pinning every skin you'd wish to see at the same time:
Skins view - Spine User Guide
Kullanıcı avatarı
Erika

Erikari
  • Mesajlar: 3049

steph

Erika yazdı:
steph yazdı:One last question, I can't find out how to display multiple skins in spine?
I have to create additional skins for my tools but I can't find how to display my characters and my tools at the same time.
You can do so by opening the skins view, then pinning every skin you'd wish to see at the same time:
Skins view - Spine User Guide
Thanks !
steph
  • Mesajlar: 7


Dön Runtimes