2D Toolkit Forum

2D Toolkit => Support => Topic started by: Francinium on March 02, 2014, 01:36:31 am

Title: Getting a list of all the sprite collections
Post by: Francinium on March 02, 2014, 01:36:31 am
Hey,
I'm wondering what would be the best way to go about getting a list of all my built sprite collections similar to the dropdown list you see on a sprite in the inspector.

I'm trying to streamline the way I build certain objects and it would be helpful to look through my list of collections and find the correct one by looking at its collection name.
Title: Re: Getting a list of all the sprite collections
Post by: unikronsoftware on March 02, 2014, 09:10:24 pm
If you need a sprite collection picker, use the same code as the internal sprite picker. Pretty much this line here in tkd2SpriteEditor.cs
      tk2dSpriteGuiUtility.SpriteSelector( targetSprites[0].Collection, targetSprites[0].spriteId, spriteChangedCallbackInstance, null );

Title: Re: Getting a list of all the sprite collections
Post by: Francinium on March 03, 2014, 12:50:25 am
Did the trick, thanks!