dd
This commit is contained in:
19
assets/script/game/component/hero/Movement.ts
Normal file
19
assets/script/game/component/hero/Movement.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user