From c86d10209174bdce1a809e3c00e3115808466b18 Mon Sep 17 00:00:00 2001 From: walkpan Date: Tue, 21 Apr 2026 23:10:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=8B=B1=E9=9B=84/UI):=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E8=8B=B1=E9=9B=84=E5=8D=87=E7=BA=A7=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E4=B8=8E=E5=8D=A1=E7=89=8C=E7=AD=89=E7=BA=A7=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E5=8C=B9=E9=85=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 英雄升级时根据具体等级播放对应的动画(plus2 到 plus5),而非之前所有大于1级都播放"plus" - 卡牌等级显示改为显示小于等于当前等级的所有节点,而非仅精确匹配当前等级 --- assets/script/game/hero/Hero.ts | 6 +++++- assets/script/game/map/HInfoComp.ts | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/assets/script/game/hero/Hero.ts b/assets/script/game/hero/Hero.ts index aa04d47c..0802b1f9 100644 --- a/assets/script/game/hero/Hero.ts +++ b/assets/script/game/hero/Hero.ts @@ -87,7 +87,11 @@ 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")} + if(hero_lv == 2){hv.playAllTime("plus")} + if(hero_lv == 3){hv.playAllTime("plus2")} + if(hero_lv == 4){hv.playAllTime("plus3")} + if(hero_lv == 5){hv.playAllTime("plus4")} + if(hero_lv == 6){hv.playAllTime("plus5")} const model = this.get(HeroAttrsComp); // 从配置中读取英雄静态数据 diff --git a/assets/script/game/map/HInfoComp.ts b/assets/script/game/map/HInfoComp.ts index a07cab29..5696c4bc 100644 --- a/assets/script/game/map/HInfoComp.ts +++ b/assets/script/game/map/HInfoComp.ts @@ -101,9 +101,12 @@ export class HInfoComp extends CCComp { // ---- 卡牌等级显示 ---- if (this.lv_node) { - const cardLvStr = `lv${this.model.pool_lv ?? 1}`; + const currentLv = this.model.lv ?? 1; this.lv_node.children.forEach(child => { - child.active = (child.name === cardLvStr); + if (child.name.startsWith('lv')) { + const nodeLv = parseInt(child.name.substring(2)); + child.active = !isNaN(nodeLv) && nodeLv <= currentLv; + } }); }