From a0b7bb6c445efdfac12b0cdee2057afa3eff3ead Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Mon, 31 Jul 2017 13:14:58 +0200 Subject: [PATCH] [libgdx] Convenience method to add all attachment from one skin to another. --- .../spine-libgdx/src/com/esotericsoftware/spine/Skin.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java index 4276c7bf8..3d571664e 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java @@ -64,6 +64,12 @@ public class Skin { attachments.put(key, attachment); } + /** Adds all attachments from the specified skin to this skin. */ + public void addAttachments (Skin skin) { + for (Entry entry : skin.attachments.entries()) + addAttachment(entry.key.slotIndex, entry.key.name, entry.value); + } + /** Returns the attachment for the specified slot index and name, or null. */ public Attachment getAttachment (int slotIndex, String name) { if (slotIndex < 0) throw new IllegalArgumentException("slotIndex must be >= 0.");