import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { Vec3 } from "cc"; /** 移动组件 */ @ecs.register('Movement') export class Movement extends ecs.Comp { /** 移动速度(像素/秒) */ speed: number = 200; /** 目标位置 */ target: Vec3 = new Vec3(); /** 当前移动方向 */ direction: Vec3 = new Vec3(); reset() { this.speed = 200; this.target.set(); this.direction.set(); } }