From d9defb7d2d932faee542ddc79fc50e18860d1587 Mon Sep 17 00:00:00 2001 From: dgflash Date: Mon, 12 Aug 2024 10:03:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96MoveTo=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8=E7=A7=BB=E5=8A=A8=E5=AE=8C=E5=90=8E=E4=B8=8D?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=87=8A=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/libs/animator-move/MoveTo.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/assets/libs/animator-move/MoveTo.ts b/assets/libs/animator-move/MoveTo.ts index abf771e..cf3e3c7 100644 --- a/assets/libs/animator-move/MoveTo.ts +++ b/assets/libs/animator-move/MoveTo.ts @@ -41,6 +41,14 @@ export class MoveTo extends Component { /** 终点备份 */ private end: Vec3 | null = null; + protected onLoad(): void { + this.enabled = false; + } + + move() { + this.enabled = true; + } + update(dt: number) { let end: Vec3; @@ -111,6 +119,6 @@ export class MoveTo extends Component { private exit() { this.onComplete?.call(this); - this.destroy(); + this.enabled = false; } } \ No newline at end of file