您不能選擇超過 %s 個話題 話題必須以字母或數字為開頭,可包含連接號 ('-') 且最長為 35 個字
 
 
 

49 行
1.5 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using CIG.Translation;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class MoreCashGoldPopupView : PopupBaseView
  7. {
  8. public void UpdateInfo(ILocalizedString title, BuyMoreCurrencyButton.BuyMoreCurrency[] paymentOptions)
  9. {
  10. this._paymentOptions = paymentOptions;
  11. this._titleLabel.LocalizedString = title;
  12. int num = this._paymentOptions.Length;
  13. for (int i = this._buyMoreButtons.Count - 1; i >= num; i--)
  14. {
  15. BuyMoreCurrencyButton buyMoreCurrencyButton = this._buyMoreButtons[i];
  16. buyMoreCurrencyButton.gameObject.SetActive(false);
  17. UnityEngine.Object.Destroy(buyMoreCurrencyButton.gameObject);
  18. this._buyMoreButtons.RemoveAt(i);
  19. }
  20. for (int j = this._buyMoreButtons.Count; j < num; j++)
  21. {
  22. this._buyMoreButtons.Add(UnityEngine.Object.Instantiate<BuyMoreCurrencyButton>(this._buyMoreCurrencyButtonPrefab, this._buyMoreLayoutGroup.transform));
  23. }
  24. for (int k = 0; k < this._paymentOptions.Length; k++)
  25. {
  26. this._buyMoreButtons[k].Init(this._paymentOptions[k]);
  27. }
  28. }
  29. public void OnGoToBankClicked()
  30. {
  31. ((MoreCashGoldPopupState)this.State).OpenBank();
  32. }
  33. [SerializeField]
  34. private LocalizedText _titleLabel;
  35. [SerializeField]
  36. private LayoutGroup _buyMoreLayoutGroup;
  37. [SerializeField]
  38. private BuyMoreCurrencyButton _buyMoreCurrencyButtonPrefab;
  39. private BuyMoreCurrencyButton.BuyMoreCurrency[] _paymentOptions;
  40. private List<BuyMoreCurrencyButton> _buyMoreButtons = new List<BuyMoreCurrencyButton>();
  41. }