[LayaAir3]最新版3.2.5 Laya.Tween 不支持坐标缓动了?? 我下载上一个版本还可以 更新后就挂了
let pos3 = new Laya.Vector3(0, -1.5, 0);
console.log(this.gameBox.transform)
Laya.Tween.to( this.gameBox.transform, { position :pos3}, 500, null, Laya.Handler.create(this, this.renderModel))
console.log(this.gameBox.transform)
Laya.Tween.to( this.gameBox.transform, { position :pos3}, 500, null, Laya.Handler.create(this, this.renderModel))
3.2 不能那样用,那是3.3的新功能写法。官网上的发版顺序是按时间来的(交替维护最新的两个分支版本)升级的时候注意版本号,用完了3.3版本,不要再降到3.2
您好,我们已经复现这个问题,感谢您的反馈,后续会进行修复
您可以先用这段代码来实现缓动效果
aaa: Laya.Vector3;
//组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
onAwake(): void {
this.aaa = new Laya.Vector3(0, 0, 0);
Laya.Tween.to( this.aaa, { x: 5 }, 500, null, Laya.Handler.create(this, () => {}));
}
//每帧更新时执行,尽量不要在这里写大循环逻辑或者使用getComponent方法
onUpdate(): void {
this.owner.transform.position = this.aaa;
}
您可以先用这段代码来实现缓动效果
aaa: Laya.Vector3;
//组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次
onAwake(): void {
this.aaa = new Laya.Vector3(0, 0, 0);
Laya.Tween.to( this.aaa, { x: 5 }, 500, null, Laya.Handler.create(this, () => {}));
}
//每帧更新时执行,尽量不要在这里写大循环逻辑或者使用getComponent方法
onUpdate(): void {
this.owner.transform.position = this.aaa;
}