2D Toolkit Forum

2D Toolkit => Support => Topic started by: wagenheimer on June 04, 2014, 05:59:46 am

Title: Change Sprite Collection on Runtime
Post by: wagenheimer on June 04, 2014, 05:59:46 am
I need to change my sprite Sprite Collection in Runtime... what is the correct way of doing this?

I need to pass tk2dSpriteCollectionData do SetSprite... Should I put all my tk2dSpriteCollectionData on Resources Folder and use Resources.Load() when needed?

What is the correct way of doing this?
Title: Re: Change Sprite Collection on Runtime
Post by: unikronsoftware on June 04, 2014, 08:04:25 pm
Its up to you, there is no correct way of doing this.
You can store a link to the tk2dSpriteCollectionData in your class and drag a reference in. The downside to this is that this asset will always be loaded in memory. Resources.Load is better in that it will only load it when you tell it to ,but you will need stuff in the resources folder.