20 lines
662 B
TypeScript
20 lines
662 B
TypeScript
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||
import { BattleStateComp } from "./BattleStateComp";
|
||
import { smc } from "../common/SingletonModuleComp";
|
||
|
||
@ecs.register('BattleStartSystem')
|
||
export class BattleStartSystem extends ecs.ComblockSystem {
|
||
filter(): ecs.IMatcher {
|
||
return ecs.allOf(BattleStateComp);
|
||
}
|
||
|
||
update(e: ecs.Entity) {
|
||
const state = e.get(BattleStateComp);
|
||
if (state.startTime === 0) {
|
||
// 初始化战斗逻辑
|
||
state.startTime = Date.now();
|
||
|
||
console.log(`战斗开始,关卡ID: ${state.missionId}`);
|
||
}
|
||
}
|
||
}
|