Hello Guest

Author Topic: Likning to sprites in ScriptableObjects  (Read 4144 times)

Serge

  • Newbie
  • *
  • Posts: 12
    • View Profile
Likning to sprites in ScriptableObjects
« on: November 06, 2015, 08:54:12 pm »
Hey,
i have some data stored in ScriptableObjects and want to store Sprites from a sprite collection in there, so i can later display this data object by switching the displayed image of an Sprite Instance. How can i do that?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Likning to sprites in ScriptableObjects
« Reply #1 on: November 14, 2015, 10:08:51 pm »
Create a serializefield that is tk2dSpriteCollectionData, then drag and drop into your scriptable object. You can then use this using SetSprite(data, spriteId) or SetSprite(data, name) on the sprite.