fix(英雄/UI): 修正英雄升级动画与卡牌等级显示的匹配逻辑
- 英雄升级时根据具体等级播放对应的动画(plus2 到 plus5),而非之前所有大于1级都播放"plus" - 卡牌等级显示改为显示小于等于当前等级的所有节点,而非仅精确匹配当前等级
This commit is contained in:
@@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user