//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Wednesday, July 18, 2018
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
|
namespace vnxbqy.UI
|
{
|
|
public class PersonalBossVipLackWin : Window
|
{
|
[SerializeField] Text m_Tip;
|
[SerializeField] Text m_Vip;
|
|
[SerializeField] Button m_ViewVip;
|
[SerializeField] Button m_Close;
|
|
|
VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
|
|
#region Built-in
|
protected override void BindController()
|
{
|
}
|
|
protected override void AddListeners()
|
{
|
m_ViewVip.AddListener(ViewVip);
|
m_Close.AddListener(CloseClick);
|
}
|
|
protected override void OnPreOpen()
|
{
|
DisplayBaseInfo();
|
}
|
|
protected override void OnAfterOpen()
|
{
|
}
|
|
protected override void OnPreClose()
|
{
|
}
|
|
protected override void OnAfterClose()
|
{
|
}
|
#endregion
|
|
|
private void DisplayBaseInfo()
|
{
|
var vipLevel = PlayerDatas.Instance.baseData.VIPLv;
|
var privilegeCount = vipModel.GetVipPrivilegeCnt(VipPrivilegeType.SelfBoss);
|
|
var nextPrivilegeCount = privilegeCount;
|
var nextVipLevel = (int)vipLevel;
|
for (int i = vipLevel + 1; i <= vipModel.vipMaxLv; i++)
|
{
|
var count = VipPrivilegeConfig.GetVipPrivilegeData(VipPrivilegeType.SelfBoss, i);
|
if (count > nextPrivilegeCount)
|
{
|
nextPrivilegeCount = count;
|
nextVipLevel = i;
|
break;
|
}
|
}
|
|
if (nextPrivilegeCount > privilegeCount)
|
{
|
m_Vip.text = nextVipLevel.ToString();
|
var rechargeCount = vipModel.GetVipPreExp(nextVipLevel) - vipModel.vipTotalExp;
|
m_Tip.text = Language.Get("VIPBossLack1", rechargeCount, nextVipLevel, nextPrivilegeCount - privilegeCount);
|
}
|
else
|
{
|
m_Vip.text = vipLevel.ToString();
|
m_Tip.text = Language.Get("VIPBossLack2");
|
}
|
}
|
|
private void ViewVip()
|
{
|
WindowCenter.Instance.Close<PersonalBossVipLackWin>();
|
WindowCenter.Instance.Open<VipRechargeWin>(false, 1);
|
}
|
}
|
|
}
|
|
|
|
|