Hello Guest

Author Topic: PoolManager + Animated Sprites from 2D Toolkit  (Read 8239 times)

dotbunny

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
PoolManager + Animated Sprites from 2D Toolkit
« 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?

dotbunny

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: PoolManager + Animated Sprites from 2D Toolkit
« Reply #1 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: PoolManager + Animated Sprites from 2D Toolkit
« Reply #2 on: June 09, 2012, 03:34:44 pm »
Is the mesh pointer valid at that point?

dotbunny

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: PoolManager + Animated Sprites from 2D Toolkit
« Reply #3 on: June 12, 2012, 05:51:16 pm »
It's still pointing to "Instance" :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: PoolManager + Animated Sprites from 2D Toolkit
« Reply #4 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?

dotbunny

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: PoolManager + Animated Sprites from 2D Toolkit
« Reply #5 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: PoolManager + Animated Sprites from 2D Toolkit
« Reply #6 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.
« Last Edit: June 15, 2012, 10:29:43 pm by unikron »

vinnie035

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: PoolManager + Animated Sprites from 2D Toolkit
« Reply #7 on: July 25, 2012, 02:52:14 pm »
Any update about this issue?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: PoolManager + Animated Sprites from 2D Toolkit
« Reply #8 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.