| | |
| | | [SerializeField] Text Money2_Text;
|
| | | [SerializeField] Text m_Text_remainingTimes;
|
| | | [SerializeField] Button m_PromotionBtn; |
| | | [SerializeField] RotationTween m_RotationTween; |
| | | [Header("滚动时间")]
|
| | | public float RollingTime = 1f; |
| | | VipModel m_Vipmodel;
|
| | |
| | | Money1_Text.text = FairyJade.ToString();
|
| | | Money2_Text.text = UIHelper.GetMoneyCnt(1).ToString();
|
| | | m_RotatePointer.Init();
|
| | | IsLottery();//判断是否拥有次数 |
| | | m_LotteryBtn.interactable = true;
|
| | | RemainingTimes();//剩余次数 |
| | | } |
| | | |
| | | protected override void OnActived()
|
| | | {
|
| | | Money1_Text.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
| | | m_RotationTween.enabled = false;
|
| | | }
|
| | | protected override void OnAfterOpen() |
| | | { |
| | | wheelOfFortuneModel.WheelOfFortuneUpdate += WheelOfFortuneUpdate; |
| | | RotatePointer.IsButtonShow += IsButtonShow;
|
| | | CheckDisplay.EndOfFlashing += EndOfFlashing; |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;//数据的刷新(h0418) |
| | | if (wheelOfFortuneModel.redPointStre1.state == RedPointState.Simple)
|
| | | {
|
| | | int GetDayOfYear = DateTime.Now.DayOfYear;
|
| | |
| | | wheelOfFortuneModel.WheelOfFortuneUpdate -= WheelOfFortuneUpdate;
|
| | | RotatePointer.IsButtonShow -= IsButtonShow;
|
| | | CheckDisplay.EndOfFlashing -= EndOfFlashing; |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= Updatefighting;//数据的刷新(h0418) |
| | | }
|
| | |
|
| | | private void Updatefighting(PlayerDataRefresh obj)
|
| | | {
|
| | | if (obj == PlayerDataRefresh.VIPLv)
|
| | | {
|
| | | RemainingTimes();//剩余次数
|
| | | }
|
| | | }
|
| | |
|
| | | private void EndOfFlashing()
|
| | |
| | | {
|
| | | m_LotteryBtn.interactable = false;
|
| | | m_RotatePointer.SetTime(m_Toggle.isOn);
|
| | | IsLottery();
|
| | | RemainingTimes();//剩余次数
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose() |
| | |
| | | |
| | | private void OnClickButton()
|
| | | {
|
| | | int LotteryNumber = vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.BindJadeWheel);
|
| | | if (LotteryNumber <= wheelOfFortuneModel.Number)
|
| | | {
|
| | | LackOfVIP(); //VIP 不足
|
| | | return;
|
| | | }
|
| | | else if (LotteryNumber > wheelOfFortuneModel.Number && (int)UIHelper.GetMoneyCnt(1) < wheelOfFortuneModel.NeedJade)
|
| | | {
|
| | | LackFairyJade();//仙玉不足
|
| | | return;
|
| | | }
|
| | | else if (LotteryNumber > wheelOfFortuneModel.Number && (int)UIHelper.GetMoneyCnt(1) >= wheelOfFortuneModel.NeedJade)
|
| | | {
|
| | | m_CheckDisplay.CloseAll();
|
| | | wheelOfFortuneModel.StartTheDraw();//开始抽奖 |
| | | }
|
| | | } |
| | | private void OnClickToggle(bool _bool)
|
| | | {
|
| | |
| | | {
|
| | | m_LotteryBtn.interactable = _bool;
|
| | | } |
| | | |
| | | private void IsLottery()
|
| | | {
|
| | | int LotteryNumber = vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.BindJadeWheel);
|
| | | if (LotteryNumber > wheelOfFortuneModel.Number)
|
| | | {
|
| | | remainingTimes = LotteryNumber - wheelOfFortuneModel.Number;
|
| | | m_LotteryBtn.interactable = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_LotteryBtn.interactable = false;
|
| | | }
|
| | | } |
| | | private Sequence mScoreSequence; |
| | | private void TiedJadeChange()//绑玉变化
|
| | | {
|
| | | m_RotationTween.enabled = true;
|
| | | mScoreSequence = DOTween.Sequence();
|
| | | mScoreSequence.SetAutoKill(false);
|
| | | mScoreSequence.Append(DOTween.To(delegate(float value)
|
| | |
| | | var temp = Math.Floor(value);
|
| | | Money1_Text.text = temp + "";
|
| | | }, FairyJade,(int)UIHelper.GetMoneyCnt(2), RollingTime));
|
| | | mScoreSequence.AppendCallback(() =>
|
| | | {
|
| | | Money1_Text.transform.localRotation = Quaternion.Euler(0, 0, 0);
|
| | | m_RotationTween.enabled = false;
|
| | |
|
| | | });
|
| | | FairyJade = (int)UIHelper.GetMoneyCnt(2);
|
| | | } |
| | | |
| | | private void LackOfVIP()//VIP 不足
|
| | | {
|
| | | string str = "次数不足,请提升VIP";
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), str, (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.VipRechargeFunc4);
|
| | | }
|
| | | });
|
| | |
|
| | | } |
| | | private void LackFairyJade()//仙玉不足
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | } |
| | | |
| | | private void RemainingTimes()//剩余次数
|
| | | {
|
| | | int LotteryNumber = vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.BindJadeWheel);
|
| | | if (LotteryNumber > wheelOfFortuneModel.Number)
|
| | | {
|
| | | m_Text_remainingTimes.text = "今日可转动次数:" + (LotteryNumber - wheelOfFortuneModel.Number);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Text_remainingTimes.text = "今日可转动次数:0";
|
| | | }
|
| | |
|
| | | } |
| | | #endregion |
| | |
|
| | | } |