fix(map): 简化英雄列表等级节点的显示逻辑

移除冗余的分支判断,仅根据等级字符串直接匹配显示对应节点,同时隐藏了多余的light和bg节点
This commit is contained in:
panw
2026-05-27 17:04:39 +08:00
parent a9c6970c9e
commit a17b5ab8db
2 changed files with 306 additions and 291 deletions

View File

@@ -219,13 +219,9 @@ export class HerosListComp extends CCComp {
const cardLvStr = `lv${hero.pool_lv ?? 1}`
this.lv_node.active = true
this.lv_node.children.forEach(child => {
if (child.name === "light") {
child.active = false
} else if (child.name === "bg") {
child.active = true
} else {
child.active = (child.name === cardLvStr)
}
child.active = (child.name === cardLvStr)
})
const widget = this.lv_node.getComponent(Widget)
if (widget) widget.updateAlignment()