Hi,
Once a custom skin is created at run-time, there is no way to delete attachments that were added to it. Within the Skin class I can see an internal class named AttachmentMap, which has a "remove()" method, but it doesn't seem to be used anywhere, with no references to it from the Skin class.
I added a new method to the Skin class in my local code, as follows:
void Skin::removeAttachment(size_t slotIndex, const String& name) {
_attachments.remove(slotIndex, name);
}
Now, this works for me, but is there a reason that this was never provided in the API? Does it have any side effects that you are aware of?
Also, from searching this forum, I read comments regarding calling this method to clear an attachment, but it didn't work:
void Skeleton::setAttachment(const String &slotName, const String &attachmentName)
Calling it like this didn't remove the attachment, even though internally I can see it sets the slot attachment to null on the skeleton:
skeleton->setAttachment("SlotID", "");
Is Skeleton::setAttachment(SlotId, "") supposed to delete the attachment from the currently assigned skin too?