From 32997f0a04f0baf43adf19601d76a461e30a3321 Mon Sep 17 00:00:00 2001 From: panw Date: Wed, 8 Apr 2026 09:09:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A6=81=E7=94=A8=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8=E5=B9=B6=E7=A7=BB=E9=99=A4=E8=8B=B1?= =?UTF-8?q?=E9=9B=84=E6=95=B0=E9=87=8F=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将角色控制器 prefab 的 _active 设为 false 以禁用该组件 - 注释掉英雄数量增加和拒绝时的动画播放逻辑,避免在英雄已满时触发无效动画 --- assets/resources/gui/role_controller.prefab | 2 +- assets/script/game/map/MissionCardComp.ts | 32 ++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/assets/resources/gui/role_controller.prefab b/assets/resources/gui/role_controller.prefab index 02fecf0b..8adad733 100644 --- a/assets/resources/gui/role_controller.prefab +++ b/assets/resources/gui/role_controller.prefab @@ -1453,7 +1453,7 @@ "__id__": 72 } ], - "_active": true, + "_active": false, "_components": [ { "__id__": 80 diff --git a/assets/script/game/map/MissionCardComp.ts b/assets/script/game/map/MissionCardComp.ts index 208f1577..24a0f58b 100644 --- a/assets/script/game/map/MissionCardComp.ts +++ b/assets/script/game/map/MissionCardComp.ts @@ -372,7 +372,7 @@ export class MissionCardComp extends CCComp { payload.cancel = true; payload.reason = "hero_limit"; oops.gui.toast(`英雄已满 (${current}/${heroMax})`); - this.playHeroNumDeniedAnim(); + // this.playHeroNumDeniedAnim(); } } @@ -972,24 +972,24 @@ export class MissionCardComp extends CCComp { private updateHeroNumUI(animate: boolean, isIncrease: boolean) { this.syncMissionHeroData(); if (!animate || !isIncrease) return; - this.playHeroNumGainAnim(); + // this.playHeroNumGainAnim(); } - private playHeroNumGainAnim() { - if (!this.hero_num_node || !this.hero_num_node.isValid) return; - const iconNode = this.hero_num_node.getChildByName("icon"); - const numNode = this.hero_num_node.getChildByName("num"); - this.playHeroNumNodePop(iconNode, 1.2); - this.playHeroNumNodePop(numNode, 1.2); - } + // private playHeroNumGainAnim() { + // if (!this.hero_num_node || !this.hero_num_node.isValid) return; + // const iconNode = this.hero_num_node.getChildByName("icon"); + // const numNode = this.hero_num_node.getChildByName("num"); + // this.playHeroNumNodePop(iconNode, 1.2); + // this.playHeroNumNodePop(numNode, 1.2); + // } - private playHeroNumDeniedAnim() { - if (!this.hero_num_node || !this.hero_num_node.isValid) return; - const iconNode = this.hero_num_node.getChildByName("icon"); - const numNode = this.hero_num_node.getChildByName("num"); - this.playHeroNumNodePop(iconNode, 1.2); - this.playHeroNumNodePop(numNode, 1.2); - } + // private playHeroNumDeniedAnim() { + // if (!this.hero_num_node || !this.hero_num_node.isValid) return; + // const iconNode = this.hero_num_node.getChildByName("icon"); + // const numNode = this.hero_num_node.getChildByName("num"); + // this.playHeroNumNodePop(iconNode, 1.2); + // this.playHeroNumNodePop(numNode, 1.2); + // } private playHeroNumNodePop(node: Node | null, scalePeak: number) { this.playNodeScalePop(node, scalePeak, 0.08, 0.1);