Files
heros/assets/script/game/common/ecs/position/BattleMoveComp.ts
2025-02-02 14:48:06 +08:00

17 lines
461 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}
}