1
Support / Re: Calling Resume() on tk2dspriteanimator causing IndexOutOfRangeException?
« on: March 21, 2014, 03:08:57 pm »
You were exactly right, I switched to PlayFromFrame(frozenFrame) and the error went away!
For posterity, this is what it looked like on the "freezing" side:
if(spriteAnimator.CurrentClip.frames[spriteAnimator.CurrentFrame].eventInfo.Equals("HIT_FREEZE"))
{
_freezeFrame = spriteAnimator.CurrentClip.frames[spriteAnimator.CurrentFrame].eventInt;
spriteAnimator.SetFrame(_freezeFrame);
spriteAnimator.Pause();
}
And the original "unfreeze" call was just a spriteAnimator.Resume(). Changing it to spriteAnimator.PlayFromFrame(_freezeFrame) resolved the error.
Thanks!!
For posterity, this is what it looked like on the "freezing" side:
if(spriteAnimator.CurrentClip.frames[spriteAnimator.CurrentFrame].eventInfo.Equals("HIT_FREEZE"))
{
_freezeFrame = spriteAnimator.CurrentClip.frames[spriteAnimator.CurrentFrame].eventInt;
spriteAnimator.SetFrame(_freezeFrame);
spriteAnimator.Pause();
}
And the original "unfreeze" call was just a spriteAnimator.Resume(). Changing it to spriteAnimator.PlayFromFrame(_freezeFrame) resolved the error.
Thanks!!