From b17ec3695ed1edeca37f33bd43792cfa477d1ee5 Mon Sep 17 00:00:00 2001 From: panw Date: Wed, 18 Mar 2026 15:17:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=8B=B1=E9=9B=84=E6=8A=80=E8=83=BD):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8A=80=E8=83=BD=E5=89=8D=E6=91=87=E4=B8=8E?= =?UTF-8?q?=E5=90=8E=E6=91=87=E5=8A=A8=E7=94=BB=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 SCastSystem 中调用 playReady 播放技能前摇动画 - 在 HeroAtkSystem 中调用 playEnd 播放技能后摇动画 - 将 playSkillEffect 重构为 playSkillAnm 以播放角色攻击动画 - 修复 HeroViewComp 中 playReady 方法名拼写错误 --- assets/script/game/hero/HeroAtkSystem.ts | 5 ++++- assets/script/game/hero/HeroViewComp.ts | 11 +++++------ assets/script/game/hero/SCastSystem.ts | 5 ++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/assets/script/game/hero/HeroAtkSystem.ts b/assets/script/game/hero/HeroAtkSystem.ts index 9892ef17..0184afd7 100644 --- a/assets/script/game/hero/HeroAtkSystem.ts +++ b/assets/script/game/hero/HeroAtkSystem.ts @@ -158,7 +158,10 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd // ✅ 触发视图层表现(伤害数字、受击动画、后退) - if (targetView) targetView.do_atked(damage, isCrit, damageEvent.s_uuid, isBack); + if (targetView) { + targetView.do_atked(damage, isCrit, damageEvent.s_uuid, isBack); + targetView.playEnd(skillConf.endAnm); + } // 检查死亡 diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 47c66fab..98222fc0 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -301,7 +301,7 @@ export class HeroViewComp extends CCComp { node.parent = this.node; } - public palayReady(anm: string = ""){ + public playReady(anm: string = ""){ if(anm==="") return; var path = "game/skill/ready/" + anm; var prefab: Prefab = oops.res.get(path, Prefab)!; @@ -516,11 +516,10 @@ export class HeroViewComp extends CCComp { // 伤害计算和战斗逻辑已迁移到 HeroBattleSystem - playSkillEffect(skill_id:number) { - let skill = SkillSet[skill_id] - mLogger.log(this.debugMode, 'HeroViewComp', '[heroview] skill_id'+skill_id,skill) - if (!skill) return; - switch(skill.act){ + playSkillAnm(act:string="") { + mLogger.log(this.debugMode, 'HeroViewComp', '[heroview] act'+act,) + if (act==="") return; + switch(act){ case "max": this.as.max() break diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index 702638b1..4894f054 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -70,7 +70,10 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate const s_uuid = castPlan.skillId; const config = SkillSet[s_uuid]; if (!config) return; - heroView.playSkillEffect(s_uuid); + //播放前摇技能动画 + heroView.playReady(config.readyAnm); + //播放角色攻击动画 + heroView.playSkillAnm(config.act); const isMainSkill = s_uuid === heroAttrs.skill_id; // 优先使用技能配置的前摇时间,否则使用全局默认值