|
- using System;
- using System.Collections.Generic;
- using CIG.Translation;
- using UnityEngine;
- using UnityEngine.UI;
-
- public class MoreCashGoldPopupView : PopupBaseView
- {
- public void UpdateInfo(ILocalizedString title, BuyMoreCurrencyButton.BuyMoreCurrency[] paymentOptions)
- {
- this._paymentOptions = paymentOptions;
- this._titleLabel.LocalizedString = title;
- int num = this._paymentOptions.Length;
- for (int i = this._buyMoreButtons.Count - 1; i >= num; i--)
- {
- BuyMoreCurrencyButton buyMoreCurrencyButton = this._buyMoreButtons[i];
- buyMoreCurrencyButton.gameObject.SetActive(false);
- UnityEngine.Object.Destroy(buyMoreCurrencyButton.gameObject);
- this._buyMoreButtons.RemoveAt(i);
- }
- for (int j = this._buyMoreButtons.Count; j < num; j++)
- {
- this._buyMoreButtons.Add(UnityEngine.Object.Instantiate<BuyMoreCurrencyButton>(this._buyMoreCurrencyButtonPrefab, this._buyMoreLayoutGroup.transform));
- }
- for (int k = 0; k < this._paymentOptions.Length; k++)
- {
- this._buyMoreButtons[k].Init(this._paymentOptions[k]);
- }
- }
-
- public void OnGoToBankClicked()
- {
- ((MoreCashGoldPopupState)this.State).OpenBank();
- }
-
- [SerializeField]
- private LocalizedText _titleLabel;
-
- [SerializeField]
- private LayoutGroup _buyMoreLayoutGroup;
-
- [SerializeField]
- private BuyMoreCurrencyButton _buyMoreCurrencyButtonPrefab;
-
- private BuyMoreCurrencyButton.BuyMoreCurrency[] _paymentOptions;
-
- private List<BuyMoreCurrencyButton> _buyMoreButtons = new List<BuyMoreCurrencyButton>();
- }
|