diff --git a/spine-cpp/spine-cpp/include/spine/Skin.h b/spine-cpp/spine-cpp/include/spine/Skin.h index de55f6035..8abc9ee9b 100644 --- a/spine-cpp/spine-cpp/include/spine/Skin.h +++ b/spine-cpp/spine-cpp/include/spine/Skin.h @@ -124,6 +124,9 @@ public: /// Returns the attachment for the specified slot index and name, or NULL. Attachment *getAttachment(size_t slotIndex, const String &name); + // Removes the attachment from the skin. + void removeAttachment(size_t slotIndex, const String& name); + /// Finds the skin keys for a given slot. The results are added to the passed array of names. /// @param slotIndex The target slotIndex. To find the slot index, use Skeleton::findSlotIndex or SkeletonData::findSlotIndex /// @param names Found skin key names will be added to this array. diff --git a/spine-cpp/spine-cpp/src/spine/Skin.cpp b/spine-cpp/spine-cpp/src/spine/Skin.cpp index 6fab005a1..aa8548040 100644 --- a/spine-cpp/spine-cpp/src/spine/Skin.cpp +++ b/spine-cpp/spine-cpp/src/spine/Skin.cpp @@ -112,6 +112,10 @@ Attachment *Skin::getAttachment(size_t slotIndex, const String &name) { return _attachments.get(slotIndex, name); } +void Skin::removeAttachment(size_t slotIndex, const String& name) { + _attachments.remove(slotIndex, name); +} + void Skin::findNamesForSlot(size_t slotIndex, Vector &names) { Skin::AttachmentMap::Entries entries = _attachments.getEntries(); while (entries.hasNext()) {