谁知道怎么用tween写一个螺旋轨迹,我这倒是螺旋运动了,可停不下来
let a = 0, b = 10, angle = 0;
const acceleration = 0.1, circleNum = 2;
let x = 0, y = 0;
let pos = v3();
tween(this.node)
.to(10, {angle: circleNum * 2 * Math.PI}, { onUpdate: (target, ratio) => {
x = (a + b * angle) * Math.cos(angle);
y = (a + b * angle) * Math.sin(angle);
pos.set(x, y, 0);
this.node.setPosition(pos);
angle += acceleration;
}})
.start();