fix(worker-generator): 映射文件不再放入 workers 目录避免微信编译错误

This commit is contained in:
yhh
2025-12-08 18:33:23 +08:00
parent 9ff03c04f3
commit e0d659fe46
13 changed files with 713 additions and 9 deletions

View File

@@ -0,0 +1,65 @@
/**
* 组件定义
* Component definitions
*/
import { Component, ECSComponent } from '@esengine/ecs-framework';
@ECSComponent('Position')
export class Position extends Component {
x: number = 0;
y: number = 0;
constructor(x: number = 0, y: number = 0) {
super();
this.x = x;
this.y = y;
}
set(x: number, y: number): void {
this.x = x;
this.y = y;
}
}
@ECSComponent('Velocity')
export class Velocity extends Component {
dx: number = 0;
dy: number = 0;
constructor(dx: number = 0, dy: number = 0) {
super();
this.dx = dx;
this.dy = dy;
}
set(dx: number, dy: number): void {
this.dx = dx;
this.dy = dy;
}
}
@ECSComponent('Physics')
export class Physics extends Component {
mass: number = 1;
bounce: number = 0.8;
friction: number = 0.95;
constructor(mass: number = 1, bounce: number = 0.8, friction: number = 0.95) {
super();
this.mass = mass;
this.bounce = bounce;
this.friction = friction;
}
}
@ECSComponent('Renderable')
export class Renderable extends Component {
color: string = '#ffffff';
size: number = 5;
constructor(color: string = '#ffffff', size: number = 5) {
super();
this.color = color;
this.size = size;
}
}