Programmer guy from the project here, I guess it's more sensible if I post here myself.
lastTime
can be <0 because the
TrackEntry
constructor initializes it to -1. As well as on the second round of a looping animation this condition becomes true.
else if (lastTime > time)
lastTime = -1;
This happens after the modulo operation though.
Now if the animation duration is anything that divides 1 on the first round the modulo operation makes this 0.
If on top of that there is only one frame in the attachment timeline at exactly 0 then the
if (frames[frameIndex] <= lastTime) return;
line always returns, since
frames[frameIndex]
is always 0 and lastTime will be 0 or bigger until the
lastTime>time
condition becomes true for the first time.
That's what causes the second long delay for switchting attachments, since it only happens when the animation has looped around once, because
lastTime
is set to a value smaller than
frames[frameIndex]
for the first time.