I'm doing a countdown animation with 24 sprites that are supposed to animate completely for every second in the countdown. The FPS is also set at 24.
I have already set up the animation to play, but somehow the sprites only play til about frame 18. I checked that the scene FPS fluctuates around 50 to 100. How do I make sure that it plays up til frame 24 for every second that passes?
Thanks in advance for any input.
UISpriteAnimation SpriteCountdown;
UILabel LabelCountdown;
public IEnumerator StartCountdown(int seconds) {
SpriteCountdown.ResetToBeginning();
SpriteCountdown.Play();
LabelCountdown.text = seconds.ToString();
for (int i=seconds;i>=0;i--) {
yield return new WaitForSeconds
(1); LabelCountdown.text = i.ToString();
if (i>0) {
SpriteCountdown.ResetToBeginning();
SpriteCountdown.Play();
}
else {
SpriteCountdown.Pause();
}
}
}