Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | CapacityDelayModel capacityDelayModel { get { return m_CapacityDelayModel ?? (m_CapacityDelayModel = ModelCenter.Instance.GetModel<CapacityDelayModel>()); } }
|
| | | FairyGrabBossModel fairyGrabBossModel { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | | private int vipExperienceSurplusTime = 0;
|
| | | private int GetLv = 0;//获取人物等级
|
| | | public void Init()
|
| | | {
|
| | | loadingtime = 0f;
|
| | |
| | |
|
| | | void Initialize()//关于数据的初始化
|
| | | {
|
| | |
|
| | | GetLv = PlayerDatas.Instance.baseData.LV;
|
| | | _LVText.text = PlayerDatas.Instance.baseData.LV.ToString();//等级的初始化
|
| | | _Hp_number.text = PlayerDatas.Instance.baseData.HP.ToString() + "/" + PlayerDatas.Instance.extersion.MaxHP.ToString();//人物血量的初始化
|
| | | _hp = (int)PlayerDatas.Instance.baseData.HP;
|
| | |
| | | break;
|
| | | case PlayerDataRefresh.LV://等级的刷新8
|
| | | _LVText.text = PlayerDatas.Instance.baseData.LV.ToString();
|
| | | if (PlayerDatas.Instance.baseData.LV > GetLv)
|
| | | {
|
| | | GetLv = PlayerDatas.Instance.baseData.LV;
|
| | | WindowCenter.Instance.Open<UpgradeWin>();
|
| | | } |
| | | break;
|
| | | case PlayerDataRefresh.MaxHP://最大血量的刷新28
|
| | | _maxHp = (int)PlayerDatas.Instance.extersion.MaxHP;
|
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | namespace Snxxz.UI
|
| | | { |
| | | |
| | | public class UpgradeWin : Window |
| | | { |
| | | [SerializeField] UIAlphaTween m_UIAlphaTween;
|
| | | [SerializeField] ScaleTween m_ScaleTween;
|
| | | [SerializeField] UIAlphaTween m_UIAlphaTween1; |
| | | [SerializeField] GameObject m_Guang; |
| | | {
|
| | | [SerializeField] ScaleTween m_ScaleTween; |
| | | [SerializeField] Text m_TextLV; |
| | | [SerializeField] UIEffect m_UIEffect; |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | // m_Guang.SetActive(false); |
| | | m_TextLV.text = PlayerDatas.Instance.baseData.LV.ToString(); |
| | | m_UIAlphaTween1.SetEndState(); |
| | |
|
| | |
|
| | | {
|
| | | m_TextLV.text = PlayerDatas.Instance.baseData.LV.ToString();
|
| | | } |
| | | protected override void OnActived()
|
| | | {
|
| | | m_UIAlphaTween.Play(ShowOverAlpha);
|
| | | m_UIEffect.Play();
|
| | | m_UIEffect.OnComplete = () => { CloseImmediately(); };
|
| | | m_ScaleTween.Play();
|
| | | } |
| | | protected override void OnAfterOpen() |
| | | {
|
| | | |
| | | WindowCenter.Instance.windowBeforeCloseEvent += windowBeforeClose;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;//数据的刷新(h0418) |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | {
|
| | | if (m_UIEffect.IsPlaying)
|
| | | {
|
| | | m_UIEffect.Stop();
|
| | | }
|
| | | WindowCenter.Instance.windowBeforeCloseEvent -= windowBeforeClose;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= Updatefighting;//数据的刷新(h0418) |
| | | }
|
| | |
|
| | | protected override void OnAfterClose() |
| | | { |
| | | }
|
| | | #endregion
|
| | | private void windowBeforeClose(Window _window)
|
| | | {
|
| | | if (_window is MainInterfaceWin)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose() |
| | | { |
| | | }
|
| | | #endregion |
| | | private void ShowOverAlpha()
|
| | | {
|
| | | m_UIAlphaTween.Play(true);
|
| | | m_UIAlphaTween1.Play(true);
|
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | int count = 0; |
| | | IsReachUpper = false; |
| | | if(canBuyCnt == 0) |
| | | { |
| | | if(isVipBuy) |
| | | { |
| | | IsReachUpper = true; |
| | | } |
| | | else |
| | | { |
| | | if (buyCnt <= 9999) |
| | | { |
| | | count = buyCnt; |
| | | } |
| | | else |
| | | { |
| | | count = 9999; |
| | | IsReachUpper = true; |
| | | } |
| | | } |
| | | {
|
| | | IsReachUpper = true; |
| | | count = 0; |
| | | } |
| | | else |
| | | { |
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig,out canBuyCnt,out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = 0;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemTipsModel.curAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | |
| | | if(curVipIndex != -1)
|
| | | {
|
| | | buyBtn.gameObject.SetActive(true);
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt,isVipBuy,out isReachUpper);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | vipInfoText.gameObject.SetActive(false);
|
| | | buyBtn.gameObject.SetActive(true);
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | }
|
| | |
|
| | | buyCountText.text = buyCnt.ToString();
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = 0;
|
| | | if(itemAttrData.itemConfig.PackCount > 1)
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | | }
|
| | |
| | | if (curVipIndex != -1)
|
| | | {
|
| | | btnGroup.gameObject.SetActive(true);
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | vipInfoText.gameObject.SetActive(false);
|
| | | btnGroup.gameObject.SetActive(true);
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | }
|
| | |
|
| | | buyCountText.text = buyCnt.ToString();
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = 0;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | _numberGo.gameObject.SetActive(true);
|
| | |
| | | if (curVipIndex != -1)
|
| | | {
|
| | | buyBtn.gameObject.SetActive(true);
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | vipInfoObj.SetActive(false);
|
| | | buyBtn.gameObject.SetActive(true);
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | }
|
| | |
|
| | | buyCountText.text = buyCnt.ToString();
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig,out canBuyCnt,out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = 0;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemTipsModel.curAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | |
| | |
|
| | | if(curVipIndex != -1)
|
| | | {
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt,isVipBuy,out isReachUpper);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | |
| | | else
|
| | | {
|
| | | vipInfoText.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | }
|
| | |
|
| | | if(buyItem.storeConfig.LimitValue != 0)
|
| | |
| | | private void OnClickNum()
|
| | | {
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value),GetRemainBuyCnt(), isVipBuy,out isReachUpper);
|
| | | buyCnt = buyItem.GetCurBuyCnt(int.Parse(numKeyboard.Value), GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | RefreshBuyPrice(buyCnt);
|
| | | numKeyboard.Value = buyCnt.ToString();
|
| | | if (isReachUpper)
|
| | |
| | |
|
| | | private void OnClickPlusBuyNum()
|
| | | {
|
| | | buyCnt += 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt,GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCnt += 1;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | if (isReachUpper)
|
| | | if (isReachUpper || buyCnt == 0)
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("StoreWin109"));
|
| | | }
|
| | |
| | |
|
| | | private void OnClickReduceBuyNum()
|
| | | {
|
| | | buyCnt -= 1;
|
| | | bool isReachUpper = false;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy,out isReachUpper);
|
| | | buyCnt -= 1;
|
| | | buyCnt = buyItem.GetCurBuyCnt(buyCnt, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | buyCountText.text = buyCnt.ToString();
|
| | | RefreshBuyPrice(buyCnt);
|
| | | }
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig,out canBuyCnt,out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = 0;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemTipsModel.curAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | |
| | |
|
| | | if(curVipIndex != -1)
|
| | | {
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt,isVipBuy,out isReachUpper);
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | |
| | | else
|
| | | {
|
| | | vipInfoText.gameObject.SetActive(false);
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | }
|
| | |
|
| | | if(buyItem.storeConfig.LimitValue != 0)
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitCnt = buyItem.CheckIsLimitBuyCnt(buyItem.storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | bool isReachUpper = false;
|
| | | buyCnt = 0;
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, GetRemainBuyCnt(), isVipBuy, out isReachUpper);
|
| | | if (itemAttrData.itemConfig.PackCount > 1)
|
| | | {
|
| | | numberGo.gameObject.SetActive(true);
|
| | |
| | | if (curVipIndex != -1)
|
| | | {
|
| | | buyBtn.gameObject.SetActive(true);
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | vipInfoText.gameObject.SetActive(false);
|
| | | buyBtn.gameObject.SetActive(true);
|
| | | buyCnt = buyItem.GetCurBuyCnt(1, canBuyCnt, isVipBuy, out isReachUpper);
|
| | | }
|
| | |
|
| | | buyCountText.text = buyCnt.ToString();
|