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; + } }); }