From 7984f8b7845d3598a0b121fff865aee41c795e55 Mon Sep 17 00:00:00 2001 From: panw Date: Thu, 30 Oct 2025 16:20:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8A=80=E8=83=BD=E7=B3=BB=E7=BB=9F):?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E7=B3=BB=E7=BB=9F=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=92=8C=E8=B0=83=E8=AF=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为SkillCastSystem、SkillCDSystem和SkillAutocastSystem添加ECS注册装饰器 在关键方法中添加console.log调试信息以便追踪系统执行流程 --- assets/script/game/hero/HSkillSystem.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/script/game/hero/HSkillSystem.ts b/assets/script/game/hero/HSkillSystem.ts index e1f212d8..a895e122 100644 --- a/assets/script/game/hero/HSkillSystem.ts +++ b/assets/script/game/hero/HSkillSystem.ts @@ -45,12 +45,14 @@ export class CastSkillRequestComp extends ecs.Comp { * - 施法检查与执行分离 * - 自动处理资源消耗和CD重置 */ +@ecs.register('SkillCastSystem') export class SkillCastSystem extends ecs.ComblockSystem implements ecs.IEntityEnterSystem { /** * 过滤器:拥有技能数据 + 施法请求的实体 */ filter(): ecs.IMatcher { + console.log("[SkillCastSystem] filter"); return ecs.allOf(HeroSkillsComp, HeroAttrsComp, CastSkillRequestComp); } @@ -181,9 +183,11 @@ export class SkillCastSystem extends ecs.ComblockSystem implements ecs.IEntityEn * - 独立的CD管理系统 * - 只负责时间递减,不处理施法逻辑 */ +@ecs.register('SkillCDSystem') export class SkillCDSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate { filter(): ecs.IMatcher { + console.log("[SkillCDSystem] filter"); return ecs.allOf(HeroSkillsComp); } @@ -210,9 +214,11 @@ export class SkillCDSystem extends ecs.ComblockSystem implements ecs.ISystemUpda * - 通过添加 CastSkillRequestComp 触发施法 * - 可被玩家输入系统或AI系统复用 */ +@ecs.register('SkillAutocastSystem') export class SkillAutocastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate { filter(): ecs.IMatcher { + console.log("[SkillAutocastSystem] filter"); return ecs.allOf(HeroSkillsComp, HeroAttrsComp, HeroViewComp); } @@ -220,7 +226,7 @@ export class SkillAutocastSystem extends ecs.ComblockSystem implements ecs.ISyst const skillsData = e.get(HeroSkillsComp); const heroModel = e.get(HeroAttrsComp); const heroView = e.get(HeroViewComp); - + console.log("[SkillAutocastSystem] update"); if (!skillsData || !heroModel || !heroView) return; // 检查基本条件