mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-10 07:31:41 +08:00
优化MoveTo组件,在移动完后不自动释放
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user