endBy function
Nothing outlives the effect: trims the life of every particle, bit and pane that would last past duration.
Implementation
void endBy(
double t,
double duration, {
Particles? ps,
Bits? bits,
Panes? panes,
}) {
final left = math.max(0.001, duration - 0.05 - t);
if (ps != null) {
for (final q in ps.list) {
if (q.life > left) q.life = left;
}
}
if (bits != null) {
for (final q in bits.list) {
if (q.life > left) q.life = left;
}
}
if (panes != null) {
for (final q in panes.list) {
if (q.life > left) q.life = left;
}
}
}