Hello Guest

Author Topic: Setting particle system renderer material to the current tk2dSprite image  (Read 3871 times)

Neeko

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 59
    • View Profile
    • Overdeveloped
As the title says, I need to set the renderer material of a particle system to match the current image of a particular tk2dSpriteAnimator. Since the sprite is animated, I have to do this programmatically at run time (I assume).

My initial assumption was that this would be a simple case of syncing up the ParticleSystemRenderer.material with the tk2dSpriteDefinition.material, however tk2dSpriteDefinition.material returns the sprite atlas, which isn't what I want. Browsing the documentation, I don't see any properties that would return the current frame image as a material. So what's my alternative?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Its not possible. The animation system uses an atlas, the unity particle system doesn't support any form of atlasing except uniformly divided textures. You'll have to duplicate the texture, or do something else to get this working.

Neeko

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 59
    • View Profile
    • Overdeveloped
That's what I was afraid of. Alright, I'll have to get creative then. Thanks for confirming!