2D Toolkit Forum

2D Toolkit => Support => Topic started by: Neeko on May 23, 2014, 11:57:41 pm

Title: Setting particle system renderer material to the current tk2dSprite image
Post by: Neeko on May 23, 2014, 11:57:41 pm
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?
Title: Re: Setting particle system renderer material to the current tk2dSprite image
Post by: unikronsoftware on May 24, 2014, 10:20:17 pm
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.
Title: Re: Setting particle system renderer material to the current tk2dSprite image
Post by: Neeko on May 24, 2014, 11:13:47 pm
That's what I was afraid of. Alright, I'll have to get creative then. Thanks for confirming!