public static int GetMoneyCountToNextVipLv(int curVipLv, int curVipExp) { VipTemplate vipT = DataTemplate.GetInstance().GetVipTemplateById(curVipLv); if (vipT == null) { LogManager.LogError("VIP 表格中不存在的VIP等级lv=" + curVipLv); return(-2); } if (vipT.getVipExp() == -1) { //Debug.Log("已满级"); return(0); } int needExp = vipT.getVipExp() - curVipExp; if (needExp <= 0) { //Debug.Log("Vip可以升级了"); return(-1); } GameConfig config = DataTemplate.GetInstance().GetGameConfig(); int fen = config.getRealmoney_to_vipexp() * needExp; //总共花多少分钱; return(fen / 100 + (fen % 100 == 0 ? 0 : 1)); }
/// <summary> /// 判断当前VIP是否满级; /// </summary> /// <returns></returns> public static bool IsVipFullLv(int curVipLv) { VipTemplate vipT = DataTemplate.GetInstance().GetVipTemplateById(curVipLv); return((vipT == null) || (vipT.getVipExp() == -1)); }