This commit is contained in:
2026-07-01 16:00:55 +08:00
parent ba01ce2df7
commit be31c6abb5
14 changed files with 3805 additions and 1787 deletions
@@ -115,15 +115,32 @@ public class UIHome_BY_VIPPanel : SubUIBase
var assets = GameManager.Instance.user.assets;
var staticInfo = GameManager.Instance.user.@static;
// 当前经验(充值金额)
double currentExp = staticInfo?.totalRecharge ?? 0;
EXP.maxValue = config.expMax;
// 进度条:显示选中等级的区间进度
EXP.minValue = config.expMin;
EXP.value = (float)currentExp;
EXP.maxValue = config.expMax;
EXP.value = Mathf.Clamp((float)currentExp, config.expMin, config.expMax);
// 经验文本:当前经验 / 选中等级上限
txt_VIPEXP.text = $"{currentExp}/{config.expMax}";
// 升到下一级所需的金额
double needAmount = config.expMax > currentExp ? config.expMax - currentExp : 0;
txt_VIPUpLeaveLabel.text =
$"再充值 <color=yellow>{needAmount}</color> 元即可升级至<color=yellow><size=36>贵族{level}</size></color>";
int nextLevel = vipLevel + 1;
bool hasNextLevel = vipConfigs.Exists(v => v.level == nextLevel);
if (needAmount > 0 && hasNextLevel)
{
txt_VIPUpLeaveLabel.text =
$"再充值 <color=yellow>{needAmount}</color> 元即可升级至<color=yellow><size=36>贵族{nextLevel}</size></color>";
}
else
{
txt_VIPUpLeaveLabel.text = "已满级";
}
txt_VIPNUnlock.text = $"贵族{level}解锁";
ShowGiftItems(config.giftList, btn_AwardItemParent_Top);