12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using System.Collections.Generic;
- using ET;
- using FairyGUI;
- using UI.LuckyBox;
- using UnityEngine;
- namespace GFGGame
- {
- public class LuckyBoxNewCardView : BaseWindow
- {
- private UI_LuckyBoxNewCardUI _ui;
- private List<int> _newCardList;
- public override void Dispose()
- {
- if (_ui != null)
- {
- _ui.Dispose();
- _ui = null;
- }
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_LuckyBoxNewCardUI.PACKAGE_NAME;
- _ui = UI_LuckyBoxNewCardUI.Create();
- this.viewCom = _ui.target;
- isfullScreen = true;
- _ui.m_loaBg.onClick.Add(OnClickBtnBg);
- }
- protected override void AddEventListener()
- {
- base.AddEventListener();
- }
- protected override void OnShown()
- {
- base.OnShown();
- _newCardList = this.viewData as List<int>;
- }
- private void updateView()
- {
- ItemCfg cfg = ItemCfgArray.Instance.GetCfg(_newCardList[0]);
- _ui.m_loaBg.url = ResPathUtil.GetCardPath(cfg.res);
- _newCardList.RemoveAt(0);
- }
- protected override void OnHide()
- {
- base.OnHide();
- }
- protected override void RemoveEventListener()
- {
- base.RemoveEventListener();
- }
- private void OnClickBtnBg()
- {
- if (_newCardList.Count > 0)
- {
- updateView();
- }
- else
- {
- this.Hide();
- }
- }
- }
- }
|