• Runtimes
  • runtime exemple of changing an attachment

Hello I would like to know what I should do using the runtime
to change an attachment in a slot, what I am trying to achieve is to change some parts
of a character inside the game in order to do be able to display him in different ways without using skins.
(because skins in my case would not work well, I need to do combination of attachments)
thanks a lot.

Is there some exemple around?

Which runtime?

For example, in java/libGDX, you would do this:

int swordSlotIndex = skeleton.findSlotIndex("sword slot");
Slot swordSlot = skeleton.slots.get(swordSlotIndex);
swordSlot.setAttachment(skeleton.getAttachment(swordSlotIndex, "short sword"));

Note that skins can be combined and picked from. Just because you need to mix and match doesn't mean Skins isn't a good solution.
Skins also makes it work better when you are also animating those slots.

Yes.
Ho sorry Pharan, I was talking about the Unity Runtime,

The API is the same in C#/Unity.