Hello Guest

Author Topic: Change Sprite Collection on Runtime  (Read 2328 times)

wagenheimer

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 50
    • View Profile
Change Sprite Collection on Runtime
« 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?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Change Sprite Collection on Runtime
« Reply #1 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.