fix(skillBox): 修复技能盒数字标签空值仍占位的问题

当技能盒没有剩余数值时,隐藏整个数字标签节点,避免空字符串标签仍占用布局空间
This commit is contained in:
panFD
2026-08-03 00:23:05 +08:00
parent 7f7c0496ca
commit 85740b32ce

View File

@@ -461,8 +461,11 @@ export class SkillBoxComp extends CCComp {
const remain = Math.max(0, Math.floor(total) - used);
this.num_label.string = `${remain}`;
}
// 有数值才显示,无数值隐藏整个节点(避免 Label 空字符串仍占位)
this.num_label.node.active = true;
} else {
this.num_label.string = "";
this.num_label.node.active = false;
}
}