Bladeren bron

Added Skin#getAttachments.

Needed for Niklas' work. Not sure it's needed for all runtimes. Note the skin placeholder names are not provided when getting the attachments this way.
NathanSweet 6 jaren geleden
bovenliggende
commit
1a4e311522
1 gewijzigde bestanden met toevoegingen van 6 en 0 verwijderingen
  1. 6 0
      spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java

+ 6 - 0
spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skin.java

@@ -101,6 +101,12 @@ public class Skin {
 			if (entry.key.slotIndex == slotIndex) attachments.add(entry.value);
 			if (entry.key.slotIndex == slotIndex) attachments.add(entry.value);
 	}
 	}
 
 
+	public void getAttachments (Array<Attachment> attachments) {
+		if (attachments == null) throw new IllegalArgumentException("attachments cannot be null.");
+		for (Attachment attachment : this.attachments.values())
+			attachments.add(attachment);
+	}
+
 	public void clear () {
 	public void clear () {
 		for (Key key : attachments.keys())
 		for (Key key : attachments.keys())
 			keyPool.free(key);
 			keyPool.free(key);