2D Toolkit Forum

2D Toolkit => Support => Topic started by: dotbunny on June 09, 2012, 02:37:41 pm

Title: PoolManager + Animated Sprites from 2D Toolkit
Post by: dotbunny on June 09, 2012, 02:37:41 pm
After the wonderful support I got via email, I thought I would post this question publicly as others may find the 'hopeful' answer useful.

I'm utilizing the PoolManager middleware (Pathologic Games) to facilitate having many reusable animated sprites. It seems that any animated sprite that is used within this system does not animated correctly.

I've watched the actual tk2dAnimatedSprite script closely, it is indicating that it is playing, it is not paused (or globally paused), the spriteID changes, as does the previous ID ... however the actual rendered sprite does not change.

I have verified that SetFrameInternal is being called as well.

Is there any other suggested points I should be looking at ?

The object pool system simply does a SetActiveRecursive type thing ....

Thoughts?
Title: Re: PoolManager + Animated Sprites from 2D Toolkit
Post by: dotbunny on June 09, 2012, 03:24:57 pm
Small update,

I've verified that UpdateVerticesImpl is being called and the meshes UV's are being adjusted; I don't really know where to go from there as thats the actual swapping point.
Title: Re: PoolManager + Animated Sprites from 2D Toolkit
Post by: unikronsoftware on June 09, 2012, 03:34:44 pm
Is the mesh pointer valid at that point?
Title: Re: PoolManager + Animated Sprites from 2D Toolkit
Post by: dotbunny on June 12, 2012, 05:51:16 pm
It's still pointing to "Instance" :)
Title: Re: PoolManager + Animated Sprites from 2D Toolkit
Post by: unikronsoftware on June 14, 2012, 05:12:36 pm
Ok. I'm rewriting the mesh handling code now, so anything I suggest here will be irrelevant in the next release. Are you OK to wait a bit?
Title: Re: PoolManager + Animated Sprites from 2D Toolkit
Post by: dotbunny on June 15, 2012, 07:05:49 pm
Heh :( not really.

Deliverable this weekend + 3 other games using the same tech getting put out in the next month.

Any suggestions would be much appreciated ... or hell I'll test anything :D
Title: Re: PoolManager + Animated Sprites from 2D Toolkit
Post by: unikronsoftware on June 15, 2012, 10:24:19 pm
Actually I've got one for you. Can you check if mesh == GetComponent<MeshFilter>().sharedMesh?
My guess is they are different. And if they are, we can try to work out how they became different.

Also get in touch by mail - I check that a lot more frequently.
Title: Re: PoolManager + Animated Sprites from 2D Toolkit
Post by: vinnie035 on July 25, 2012, 02:52:14 pm
Any update about this issue?
Title: Re: PoolManager + Animated Sprites from 2D Toolkit
Post by: unikronsoftware on July 25, 2012, 06:10:32 pm
We worked out in the end that it wasn't poolmanager but what DotBunny was doing to the object...

Basically he was calling GetComponent<MeshFilter>().mesh.bounds.size, but calling .mesh copies the mesh and creates a copy - 2D Toolkit was still attached to the original mesh and was modifying that one.