| | |
| | | [SerializeField] Button investBtn;
|
| | | [SerializeField] GameObject m_Realized_BGM;
|
| | | [SerializeField] Text m_RemainingDays;//剩余天数
|
| | | //---------------------------------
|
| | | [SerializeField] Transform m_ButtonGroup;//按钮组
|
| | | [SerializeField] Button m_Button_one;
|
| | | [SerializeField] Button m_Button_Two;
|
| | | [SerializeField] Button m_Button_Three;
|
| | | [SerializeField] Button m_Button_Four;
|
| | |
|
| | | [SerializeField] Button m_GoToVipBoss;
|
| | | VipInvestModel _investModel;
|
| | | VipInvestModel investModel { get { return _investModel ?? (_investModel = ModelCenter.Instance.GetModel<VipInvestModel>()); } }
|
| | |
| | | {
|
| | | ctrl.OnRefreshCell += RefreshRewardCell;
|
| | | ctrl.lockType = EnhanceLockType.KeepVertical;
|
| | | investBtn.AddListener(ClickInvestBtn);
|
| | | |
| | | }
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_Button_one.AddListener(OnclickButtonOne);
|
| | | m_Button_Two.AddListener(OnClickButtonTwo);
|
| | | m_Button_Three.AddListener(OnClickButtonThree);
|
| | | m_Button_Four.AddListener(OnClickButtonFour);
|
| | | investBtn.AddListener(ClickInvestBtn);
|
| | | m_GoToVipBoss.AddListener(OnClickVipBossWin);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | m_RemainingDays.text = string.Format(Language.Get("TheRemainingNumberDays_Z"), UIHelper.GetTextColorByItemColor(TextColType.Green, (28 - InvestInfo.curDay).ToString(), true));
|
| | | m_RemainingDays.text = string.Format(Language.Get("TheRemainingNumberDays_Z"), UIHelper.GetTextColorByItemColor(TextColType.Green, (7 - InvestInfo.curDay).ToString(), true));
|
| | | }
|
| | |
|
| | | if (InvestInfo.investGold <= 0)
|
| | |
| | | m_Realized_BGM.SetActive(true);
|
| | | investBtn.gameObject.SetActive(false);
|
| | | }
|
| | | SwithWeek(cycle);
|
| | | //configlist = investModel.GetInvestConfiglistByCycle(cycle);
|
| | | //CreateRewardCell();
|
| | | configlist = investModel.GetInvestConfiglistByCycle(cycle);
|
| | | CreateRewardCell();
|
| | | investModel.RefreshInvestAct += RefreshInvestState;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | investModel.RefreshInvestAct -= RefreshInvestState;
|
| | |
| | | protected override void OnAfterClose()
|
| | | {
|
| | | }
|
| | |
|
| | |
|
| | | private void RefreshInvestState(int obj)
|
| | | {
|
| | | if (obj == 2)
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | m_RemainingDays.text = string.Format(Language.Get("TheRemainingNumberDays_Z"), UIHelper.GetTextColorByItemColor(TextColType.Green, (28 - InvestInfo.curDay).ToString(), true));
|
| | | m_RemainingDays.text = string.Format(Language.Get("TheRemainingNumberDays_Z"), UIHelper.GetTextColorByItemColor(TextColType.Green, (7 - InvestInfo.curDay).ToString(), true));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | itemBaisc.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | button.RemoveAllListeners();
|
| | | RewardRecordState recordState = investModel.GetRecordByIndex((int)InvestType.Vip, config.needDay);
|
| | | switch (recordState)
|
| | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | private void ClickReceiveBtn(InvestConfig config)
|
| | | {
|
| | | investModel.SendGetInvestRewardQuest((int)InvestType.Vip, config.needDay);
|
| | |
| | |
|
| | | private void ClickInvestBtn()
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.VIPLv < 4)
|
| | | if (PlayerDatas.Instance.baseData.VIPLv < 3)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("VipInvestmentLimit");
|
| | | return;
|
| | | }
|
| | |
|
| | |
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("WhetherToInvest_Z"), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | int getFairyJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | if (getFairyJade >= 300)
|
| | | if (getFairyJade >= 98)
|
| | | {
|
| | | investModel.SendInvestQuest((int)InvestType.Vip, 0);
|
| | | }
|
| | |
| | |
|
| | | }
|
| | | });
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | private void CloseAllSelected()
|
| | | {
|
| | | for (int i = 0; i < m_ButtonGroup.childCount; i++)
|
| | | {
|
| | | var selected = m_ButtonGroup.GetChild(i).transform.Find("Selected").gameObject;
|
| | | if (selected.activeSelf)
|
| | | {
|
| | | selected.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnclickButtonOne()
|
| | | {
|
| | | CloseAllSelected();
|
| | | var selected = m_Button_one.transform.Find("Selected").gameObject;
|
| | | if (!selected.activeSelf)
|
| | | {
|
| | | selected.SetActive(true);
|
| | | }
|
| | | cycle = 1;
|
| | | configlist = investModel.GetInvestConfiglistByCycle(cycle);
|
| | | CreateRewardCell();
|
| | | }
|
| | |
|
| | | private void OnClickButtonTwo()
|
| | | {
|
| | | CloseAllSelected();
|
| | | var selected = m_Button_Two.transform.Find("Selected").gameObject;
|
| | | if (!selected.activeSelf)
|
| | | {
|
| | | selected.SetActive(true);
|
| | | }
|
| | | cycle = 2;
|
| | | configlist = investModel.GetInvestConfiglistByCycle(cycle);
|
| | | CreateRewardCell();
|
| | | }
|
| | | private void OnClickButtonThree()
|
| | | {
|
| | | CloseAllSelected();
|
| | | var selected = m_Button_Three.transform.Find("Selected").gameObject;
|
| | | if (!selected.activeSelf)
|
| | | {
|
| | | selected.SetActive(true);
|
| | | }
|
| | | cycle = 3;
|
| | | configlist = investModel.GetInvestConfiglistByCycle(cycle);
|
| | | CreateRewardCell();
|
| | | }
|
| | | private void OnClickButtonFour()
|
| | | {
|
| | | CloseAllSelected();
|
| | | var selected = m_Button_Four.transform.Find("Selected").gameObject;
|
| | | if (!selected.activeSelf)
|
| | | {
|
| | | selected.SetActive(true);
|
| | | }
|
| | | cycle = 4;
|
| | | configlist = investModel.GetInvestConfiglistByCycle(cycle);
|
| | | CreateRewardCell();
|
| | | }
|
| | | private void OnClickVipBossWin()
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.FindPreciousFrameFunc3);
|
| | | }
|
| | |
|
| | | private void SwithWeek(int cycle_int)
|
| | | {
|
| | | switch (cycle_int)
|
| | | {
|
| | | case 1:
|
| | | OnclickButtonOne();
|
| | | break;
|
| | | case 2:
|
| | | OnClickButtonTwo();
|
| | | break;
|
| | | case 3:
|
| | | OnClickButtonThree();
|
| | | break;
|
| | | case 4:
|
| | | OnClickButtonFour();
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | }
|