17 lines
461 B
TypeScript
17 lines
461 B
TypeScript
import { ecs } from "../../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||
@ecs.register('BattleMove')
|
||
|
||
export class BattleMoveComp extends ecs.Comp {
|
||
/** 移动方向:1向右,-1向左 */
|
||
direction: number = 1;
|
||
/** 目标x坐标 */
|
||
targetX: number = 0;
|
||
/** 是否处于移动状态 */
|
||
moving: boolean = true;
|
||
|
||
reset() {
|
||
this.direction = 1;
|
||
this.targetX = 0;
|
||
this.moving = true;
|
||
}
|
||
}
|