Files
heros/assets/script/game/battle/BattleStartSystem.ts
2025-02-03 22:02:26 +08:00

20 lines
662 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";
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}`);
}
}
}