From 5d188bb5aa7beadc67131cc25a4bb9ac2247f450 Mon Sep 17 00:00:00 2001 From: walkpan Date: Sun, 5 Apr 2026 22:55:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=8B=B1=E9=9B=84=E5=8A=A8=E7=94=BB):=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=AD=BB=E4=BA=A1=E7=8A=B6=E6=80=81=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E5=8A=A8=E7=94=BB=E7=9A=84=E4=BD=8D=E7=BD=AE=E5=9F=BA?= =?UTF-8?q?=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将死亡状态动画的播放从 playReady 改为 playOther,并确保动画以英雄当前位置为基准挂载到父节点,避免英雄节点销毁时动画被中断。 --- assets/script/game/hero/HeroViewComp.ts | 3 ++- assets/script/game/hero/SCastSystem.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 061bb5b3..9f05e42c 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -304,7 +304,8 @@ export class HeroViewComp extends CCComp { public playOther(anm: string = ""){ if(anm==="") return; var path = "game/skill/ready/" + anm; - this.spawnAnimEndFx(path, this.node.parent, undefined); + // 以自身当前位置为基准,挂载到父节点,即使自身节点销毁动画也能继续播放 + this.spawnAnimEndFx(path, this.node.parent, this.node.position); } public playEnd(anm: string = ""){ if(anm==="") return; diff --git a/assets/script/game/hero/SCastSystem.ts b/assets/script/game/hero/SCastSystem.ts index 6d153ee2..48f73d44 100644 --- a/assets/script/game/hero/SCastSystem.ts +++ b/assets/script/game/hero/SCastSystem.ts @@ -100,7 +100,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate if (triggerType === 'call') { heroView.playReady("yellow"); } else if (triggerType === 'dead') { - heroView.playReady("dead"); + heroView.playOther("dead"); } // 如果是敌方攻击技能,必须在战斗中才能释放;友方增益/护盾则允许在非战斗中释放