From e0a2054397a2fb5a2a60e8a68db12aca1312b3d2 Mon Sep 17 00:00:00 2001 From: dgflash Date: Tue, 8 Apr 2025 20:20:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4console.assert=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=9A=84=E5=BC=95=E7=94=A8=EF=BC=8C=E8=A7=84=E9=81=BF?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E6=B8=B8=E6=88=8F=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E4=B8=8D=E5=85=BC=E5=AE=B9=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/libs/animator-move/MoveTo.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/libs/animator-move/MoveTo.ts b/assets/libs/animator-move/MoveTo.ts index 6b3792d..5addcf3 100644 --- a/assets/libs/animator-move/MoveTo.ts +++ b/assets/libs/animator-move/MoveTo.ts @@ -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;