删除console.assert方法的引用,规避微信小游戏平台不兼容报错

This commit is contained in:
dgflash
2025-04-08 20:20:53 +08:00
parent 2d5d143160
commit e0a2054397

View File

@@ -52,7 +52,10 @@ export class MoveTo extends Component {
update(dt: number) {
let end: Vec3;
console.assert(this.speed > 0, "移动速度必须要大于零");
if (this.speed <= 0) {
console.error("移动速度必须要大于零");
return;
}
if (this.target instanceof Node) {
end = this.ns == Node.NodeSpace.WORLD ? this.target.worldPosition : this.target.position;