战斗管理系统基础
This commit is contained in:
20
assets/script/game/battle/BattleStartSystem.ts
Normal file
20
assets/script/game/battle/BattleStartSystem.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user