123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using UI.RechargeStore;
- using UI.CommonGame;
- using FairyGUI;
- namespace GFGGame
- {
- public class RechargeStoreView : BaseWindow
- {
- private UI_RechargeStoreUI _ui;
- private ValueBarController _valueBarController;
- public override void Dispose()
- {
- _valueBarController.Dispose();
- _valueBarController = null;
- if (_ui != null)
- {
- _ui.Dispose();
- }
- _ui = null;
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_RechargeStoreUI.PACKAGE_NAME;
- _ui = UI_RechargeStoreUI.Create();
- this.viewCom = _ui.target;
- isfullScreen = true;
- _valueBarController = new ValueBarController(_ui.m_valueBar);
- _ui.m_btnBack.onClick.Add(OnClickBtnBack);
- InitList();
- }
- protected override void OnShown()
- {
- base.OnShown();
- _valueBarController.OnShown();
- }
- protected override void OnHide()
- {
- base.OnHide();
- _valueBarController.OnHide();
- }
- private void OnClickBtnBack()
- {
- this.Hide();
- }
- private void InitList()
- {
- _ui.m_list.RemoveChildren();
- RechargeCfg[] dataArray = RechargeCfgArray.Instance.dataArray;
- int len = dataArray.Length;
- for (int i = 0; i < len; i++)
- {
- RechargeCfg itemData = dataArray[i];
- UI_StoreListItem itemUI = UI_StoreListItem.Proxy();
- itemUI.m_btnBuy.text = "¥" + itemData.price;
- itemUI.m_btnBuy.onClick.Add(() =>
- {
- RechargeSProxy.ReqRecharge(itemData.id).Coroutine();
- });
- itemUI.m_txtName.text = itemData.name + "x" + itemData.itemNum;
- itemUI.m_imgDouble.visible = false;
- itemUI.m_icon.url = "ui://RechargeStore/sc_zizhuan_" + itemData.id;
- _ui.m_list.AddChild(itemUI.target);
- // int order = i + 1;
- // if((order)%3 == 0 && order < len)
- // {
- // GLoader line = new GLoader();
- // line.autoSize = true;
- // line.url = "ui://RechargeStore/sc_kuangjiazi_2";
- // _ui.m_list.AddChild(line);
- // }
- UI_StoreListItem.ProxyEnd();
- }
- }
- }
- }
|