我本来打算这样…
for (let i = 0; i < 10; i++) {
tween(this.node).delay(interval * i).sequence(
this.tween_textRoll(i, noteIndex),
this.tween_playNote(noteIndex),
this.tween_luoboMove(noteIndex),
this.tween_cookieMove(noteIndex),
this.tween_cookieDrop(noteIndex),
).start();
}
甚至这样…
function play_Popup_Anime() {
tween(this.$popup)
.by(0.5, { eulerAngles: new Vec3(0, 0, -75) }, { easing: easing.sineIn })
.then(this.tween_on_Popup_Full())
.by(1, { eulerAngles: new Vec3(0, 0, 75) }, { easing: easing.sineOut })
.start();
}
function tween_on_Popup_Full(interval = 0.5) {
const tws: Tween<Node>[] = [];
for (let i = 0; i < 10; i++) {
tws.push(tween(this.node).delay(interval * i).sequence(
this.tween_textRoll(i, noteIndex),
this.tween_playNote(noteIndex),
this.tween_luoboMove(noteIndex),
this.tween_cookieMove(noteIndex),
this.tween_cookieDrop(noteIndex),
).start());
}
return tween(this.node).parallel(...tws);
}
结果只能这样…
for (let i = 0; i < 10; i++) {
setTimeout(() => {
this.tween_textRoll(i, noteIndex).call(() =>
this.tween_playNote(noteIndex).call(() =>
this.tween_luoboMove(noteIndex).call(() =>
this.tween_cookieMove(noteIndex).call(() =>
this.tween_cookieDrop(noteIndex).call(() => { }
).start()
).start()
).start()
).start()
).start()
}, interval * i * 1000);
}
不是吧大哥…
这样子的Tween是怎么能接受的…???