Files
pixelheros/assets/script/game/hero/HeroAttrEventSystem.ts
walkpan e343e26862 refactor(游戏逻辑): 拆分游戏暂停和播放状态的检查条件
将多处 `if(!smc.mission.play || smc.mission.pause)` 条件判断拆分为独立的if语句
在VictoryComp中正确设置pause状态
移除MissionComp中多余的pause状态重置
2026-01-03 19:04:41 +08:00

51 lines
1.5 KiB
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 { Timer } from "db://oops-framework/core/common/timer/Timer";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { smc } from "../common/SingletonModuleComp";
import { Attrs } from "../common/config/HeroAttrs";
import { HeroUpSet } from "../common/config/heroSet";
import { HeroSkillsComp } from "./HeroSkills";
import { HeroAttrsComp } from "./HeroAttrsComp";
import { HeroAttrEvent } from "./HeroAttrEvent";
/**
* ==================== 英雄属性更新系统 ====================
*
* 按照 ECS 设计理念:
* - SystemHeroAttrEventSystem处理属性更新事件
*
* 系统职责:
* 1. 处理当角色收到attr变更事件时更新角色属性并处理动画展示
*/
@ecs.register('HeroAttrEventSystem')
export class HeroAttrEventSystem extends ecs.ComblockSystem
implements ecs.ISystemUpdate, ecs.IEntityEnterSystem {
filter(): ecs.IMatcher {
return ecs.allOf(HeroAttrsComp,HeroAttrEvent);
}
entityEnter(e: ecs.Entity): void {
}
update(e: ecs.Entity): void {
if(!smc.mission.play ) return;
if(smc.mission.pause) return
const model = e.get(HeroAttrsComp);
if (!model || model.is_dead) return;
const event = e.get(HeroAttrEvent);
if (!event) return;
// 移除事件组件(事件处理完成)
}
/**
* 启用调试模式(调试时使用)
*/
enableDebug() {
}
/**
* 禁用调试模式(正式运行)
*/
disableDebug() {
}
}