oddgames / UIToolkit

Single draw call UI solution for Unity with multi resolution support and more.
518 stars 153 forks source link

playSpriteAnimation with useful loopCount (with solution) #119

Open mrKaizen opened 12 years ago

mrKaizen commented 12 years ago

I use the new PlaySpriteAnimation and I see that my animation never stops, the loopCount doesn't count.

I think it's just a bug: in UISpriteAnimation class, row 36, I changed this:

while( _isPlaying && ( loopCount >= 0 || loopCount == -1 ) ){...}

to this: while( _isPlaying && ( loopCount > 0 || loopCount == -1 ) ){...}

so when loopCount is 0, the while cycle stops and so the animation.