| | |
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | //仙玉投资
|
| | | namespace Snxxz.UI {
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class FairyJadeInvestmentWin : Window
|
| | | {
|
| | |
| | | [SerializeField] ScrollerController m_ScrollerController;
|
| | | [SerializeField] Button m_InvestmentButton;//投资按钮
|
| | | [SerializeField] GameObject m_MaxInverstment;//最大投资上限
|
| | | [SerializeField] Button m_RealizedInvestmentButton;//追加投资
|
| | | [SerializeField] Button m_RealizedInvestmentButton;//追加投资
|
| | | [SerializeField] Button m_SelectButton;//额度选择
|
| | | [SerializeField] Text m_TextNumber;
|
| | |
|
| | |
| | | [SerializeField] Text m_JadeText;//所需投资仙玉
|
| | |
|
| | | [SerializeField] Image m_Image_AD;//投资图片
|
| | |
|
| | | [SerializeField] Image m_Image1;
|
| | | [SerializeField] Image m_Image2;
|
| | | [SerializeField] Image m_Image3;
|
| | | public static event Action FairyJadeInvestmentRedPointEvent;
|
| | | #region Built-in
|
| | | private List<int> GearPositionList = new List<int>();
|
| | | private string[] IconList1 = new string[4];
|
| | | private string[] IconList2 = new string[4];
|
| | | private string[] IconList3 = new string[4];
|
| | | protected override void BindController()
|
| | | {
|
| | | var JadeInves = Config.Instance.Get<FuncConfigConfig>("JadeInvestIconKey");
|
| | | int[] GearPosition = ConfigParse.GetMultipleStr<int>(JadeInves.Numerical1);
|
| | | GearPositionList.Clear();
|
| | | for (int i = 0; i < GearPosition.Length; i++)
|
| | | {
|
| | | GearPositionList.Add(GearPosition[i]);
|
| | | }
|
| | | IconList1 = ConfigParse.GetMultipleStr(JadeInves.Numerical2);
|
| | | IconList2 = ConfigParse.GetMultipleStr(JadeInves.Numerical3);
|
| | | IconList3 = ConfigParse.GetMultipleStr(JadeInves.Numerical4);
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | |
| | | m_JadeText.gameObject.SetActive(true);
|
| | | m_JadeText.text = string.Format(Language.Get("FairyJadeInvestment_9"), fairyJadeInvestmentModel.SelectNumber - fairyJadeInvestmentModel.InvestGold);
|
| | | }
|
| | |
|
| | | IsInvestment();
|
| | | IsInvestment();
|
| | | GetMoney();
|
| | | SetIconKeyImage();
|
| | | m_TextNumber.text = fairyJadeInvestmentModel.SelectNumber.ToString();
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;//数据的刷新(h0418)
|
| | | FairyJadeInvestmentModel.FairyJadeInfoSeriorsUpdate += FairyJadeInfoSeriorsUpdate;
|
| | |
| | | m_ScrollerController.JumpIndex(fairyJadeInvestmentModel.JumpInedx);
|
| | | }
|
| | |
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | if (fairyJadeInvestmentModel.redPointStre1.state==RedPointState.Simple)
|
| | | if (fairyJadeInvestmentModel.redPointStre1.state == RedPointState.Simple)
|
| | | {
|
| | | fairyJadeInvestmentModel.IsRedpoint = false;
|
| | | if (FairyJadeInvestmentRedPointEvent != null)
|
| | |
| | | private void SelectNumberRefresh()
|
| | | {
|
| | | m_TextNumber.text = fairyJadeInvestmentModel.SelectNumber.ToString();
|
| | | SetIconKeyImage();
|
| | | if (fairyJadeInvestmentModel.InvestGold >= fairyJadeInvestmentModel.RecordSelectNumberMax)
|
| | | {
|
| | | m_JadeText.gameObject.SetActive(false);
|
| | |
| | | if (fairyJadeInvestmentModel.InvestGold < fairyJadeInvestmentModel.RecordSelectNumberMax)
|
| | | {
|
| | | m_MaxInverstment.SetActive(false);
|
| | | |
| | |
|
| | | if (fairyJadeInvestmentModel.InvestGold > 0)
|
| | | {
|
| | | m_Image_AD.SetSprite("XT_VIP_106");
|
| | |
| | | m_MaxInverstment.SetActive(true);
|
| | | m_InvestmentButton.gameObject.SetActive(false);
|
| | | m_RealizedInvestmentButton.gameObject.SetActive(false);
|
| | | } |
| | | }
|
| | | }
|
| | |
|
| | | private void InvestmentButton()//仙玉投资
|
| | |
| | | }
|
| | | if (fairyJadeInvestmentModel.InvestGold > 0)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), string.Format(Language.Get("FairyJadeInvestment_2"), fairyJadeInvestmentModel.SelectNumber- fairyJadeInvestmentModel.InvestGold), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | ConsumeFairyJade(fairyJadeInvestmentModel.SelectNumber);
|
| | | }
|
| | | });
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), string.Format(Language.Get("FairyJadeInvestment_2"), fairyJadeInvestmentModel.SelectNumber - fairyJadeInvestmentModel.InvestGold), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | ConsumeFairyJade(fairyJadeInvestmentModel.SelectNumber);
|
| | | }
|
| | | });
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | ConsumeFairyJade(fairyJadeInvestmentModel.SelectNumber);
|
| | | }
|
| | | });
|
| | | } |
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | private void RealizedInvestment_Button()//追加投资按钮
|
| | |
| | |
|
| | | private void ConsumeFairyJade(int fairyJade)
|
| | | {
|
| | | int getFairyJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | if (getFairyJade>= (fairyJade- fairyJadeInvestmentModel.InvestGold))
|
| | | int getFairyJade = (int)UIHelper.GetMoneyCnt(1);
|
| | | if (getFairyJade >= (fairyJade - fairyJadeInvestmentModel.InvestGold))
|
| | | {
|
| | | fairyJadeInvestmentModel.InvestmentMonthlyInvestment(3, fairyJade);
|
| | | }
|
| | |
| | | private void GetMoney()
|
| | | {
|
| | | m_FairyJadeText.text = UIHelper.GetMoneyCnt(1).ToString();
|
| | | m_TieTheJadeText.text= UIHelper.GetMoneyCnt(2).ToString();
|
| | | m_TieTheJadeText.text = UIHelper.GetMoneyCnt(2).ToString();
|
| | | }
|
| | |
|
| | |
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void SetIconKeyImage()
|
| | | {
|
| | | var money = fairyJadeInvestmentModel.SelectNumber;
|
| | | if (fairyJadeInvestmentModel.InvestmentAmountDic.ContainsKey(money))
|
| | | {
|
| | | var type = fairyJadeInvestmentModel.InvestmentAmountDic[money];
|
| | | if (GearPositionList.Contains(type))
|
| | | {
|
| | | int Inedx = GearPositionList.IndexOf(type);
|
| | | m_Image1.SetSprite(IconList1[Inedx]);
|
| | | m_Image1.SetNativeSize();
|
| | | m_Image2.SetSprite(IconList2[Inedx]);
|
| | | m_Image2.SetNativeSize();
|
| | | m_Image3.SetSprite(IconList3[Inedx]);
|
| | | m_Image3.SetNativeSize();
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|