refactor: 使用标签组件简化卡牌池等级显示逻辑
- 将多个子节点激活控制替换为直接设置 Label 组件的文本 - 移除冗余的节点引用和条件判断 - 添加节点弹出动画以增强视觉反馈
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -547,18 +547,9 @@ export class MissionCardComp extends CCComp {
|
||||
if (this.pool_lv_node) {
|
||||
this.pool_lv_node.active = true;
|
||||
const lv = Math.max(CARD_POOL_INIT_LEVEL, Math.min(CARD_POOL_MAX_LEVEL, Math.floor(this.poolLv)));
|
||||
const lv1 = this.pool_lv_node.getChildByName("lv1");
|
||||
const lv2 = this.pool_lv_node.getChildByName("lv2");
|
||||
const lv3 = this.pool_lv_node.getChildByName("lv3");
|
||||
const lv4 = this.pool_lv_node.getChildByName("lv4");
|
||||
const lv5 = this.pool_lv_node.getChildByName("lv5");
|
||||
const lv6 = this.pool_lv_node.getChildByName("lv6");
|
||||
if (lv1) lv1.active = lv >= 1;
|
||||
if (lv2) lv2.active = lv >= 2;
|
||||
if (lv3) lv3.active = lv >= 3;
|
||||
if (lv4) lv4.active = lv >= 4;
|
||||
if (lv5) lv5.active = lv >= 5;
|
||||
if (lv6) lv6.active = lv >= 6;
|
||||
this.pool_lv_node.getComponent(Label).string = `${lv}`;
|
||||
const peak = 1.2
|
||||
this.playHeroNumNodePop( this.pool_lv_node, peak);
|
||||
}
|
||||
mLogger.log(this.debugMode, "MissionCardComp", "pool lv ui update", {
|
||||
poolLv: this.poolLv,
|
||||
|
||||
Reference in New Issue
Block a user