From c40fbfe4e4f6705aa9df2cf55a56dc37b8d2c146 Mon Sep 17 00:00:00 2001 From: walkpan Date: Sat, 4 Apr 2026 09:23:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=8B=BC=E5=86=99?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=B9=B6=E6=B7=BB=E5=8A=A0=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=E6=92=AD=E6=94=BE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 `palayBuff` 方法名更正为 `playBuff` - 在英雄升级时调用 `playAllTime` 方法播放"plus"动画 - 确保动画播放方法在参数为空时安全返回 --- assets/script/game/hero/Hero.ts | 2 ++ assets/script/game/hero/HeroViewComp.ts | 8 ++++++-- assets/script/game/map/MissionCardComp.ts | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index 73348c8b..6ac80bad 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -87,6 +87,8 @@ export class Hero extends ecs.Entity { mLogger.log(this.debugMode,"hero",node.getSiblingIndex()); var hv = node.getComponent(HeroViewComp)!; + if(hero_lv >1){hv.playAllTime("plus")} + const model = this.get(HeroAttrsComp); // 从配置中读取英雄静态数据 let hero = HeroInfo[uuid]; diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index a26ee146..9a31ba86 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -289,7 +289,7 @@ export class HeroViewComp extends CCComp { shield_tip(absorbed: number) { this.hp_tip(TooltipTypes.life, NumberFormatter.formatNumber(Math.max(0, Math.floor(absorbed)))); } - public palayBuff(anm: string = ""){ + public playBuff(anm: string = ""){ if(anm==="") return; var path = "game/skill/buff/" + anm; this.spawnTimedFx(path, this.node, this.effectLifeTime); @@ -306,7 +306,11 @@ export class HeroViewComp extends CCComp { var path = "game/skill/end/" + anm; this.spawnAnimEndFx(path, this.node, undefined); } - + public playAllTime(anm: string = ""){ + if(anm==="") return; + var path = "game/skill/buff/" + anm; + this.spawnAnimEndFx(path, this.node, undefined); + } /** 治疗特效 */ private heathed() { this.spawnAnimEndFx("game/skill/buff/heathed", this.node, undefined); diff --git a/assets/script/game/map/MissionCardComp.ts b/assets/script/game/map/MissionCardComp.ts index 558b4005..3b3a1c2c 100644 --- a/assets/script/game/map/MissionCardComp.ts +++ b/assets/script/game/map/MissionCardComp.ts @@ -771,7 +771,7 @@ export class MissionCardComp extends CCComp { const target = candidates[Math.floor(Math.random() * candidates.length)]; this.applyHeroLevel(target.model, toLv); if (target.view) { - target.view.palayBuff("buff_lvup"); + target.view.playBuff("buff_lvup"); } return true; }