| | |
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | //仙玉投资
|
| | | namespace Snxxz.UI {
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
|
| | | public class FairyJadeInvestmentWin : Window
|
| | | {
|
| | |
| | | [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();
|
| | | GetMoney();
|
| | | SetIconKeyImage();
|
| | | m_TextNumber.text = fairyJadeInvestmentModel.SelectNumber.ToString();
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += Updatefighting;//数据的刷新(h0418)
|
| | | FairyJadeInvestmentModel.FairyJadeInfoSeriorsUpdate += FairyJadeInfoSeriorsUpdate;
|
| | |
| | | OnCreateGridLineCell(m_ScrollerController);
|
| | | m_ScrollerController.JumpIndex(fairyJadeInvestmentModel.JumpInedx);
|
| | | }
|
| | |
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | |
| | | private void SelectNumberRefresh()
|
| | | {
|
| | | m_TextNumber.text = fairyJadeInvestmentModel.SelectNumber.ToString();
|
| | | SetIconKeyImage();
|
| | | if (fairyJadeInvestmentModel.InvestGold >= fairyJadeInvestmentModel.RecordSelectNumberMax)
|
| | | {
|
| | | m_JadeText.gameObject.SetActive(false);
|
| | |
| | | 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();
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|