| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- using System.Collections.Generic;
- using cfg.GfgCfg;
- using ET;
- using FairyGUI;
- using UI.LuckyBox;
- using UnityEngine;
- namespace GFGGame
- {
- public class LuckyBoxNewCardView : BaseWindow
- {
- private UI_LuckyBoxNewCardUI _ui;
- // private List<int> _newCardList = new List<int>();
- // private List<ItemData> _newDressList = new List<ItemData>();
- private int _cardId;
- 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(OnClickBg);
- _ui.m_btnShare.onClick.Add(OnClickShare);
- }
- protected override void AddEventListener()
- {
- base.AddEventListener();
- }
- protected override void OnShown()
- {
- base.OnShown();
- _ui.m_loaBg.touchable = false;
- _cardId = (int)this.viewData;
- // _newCardList = new List<int>((this.viewData as object[])[0] as List<int>);
- if (!GetSuitItemController.isAuto)
- {
- _ui.m_btnShare.visible = false;
- }
- else
- {
- _ui.m_btnShare.visible = false;
- }
- updateView();
- Timers.inst.Add(0.5f, 1, OnTimerClick);
- }
- private void updateView()
- {
- ItemCfg cfg = CommonDataManager.Tables.TblItemCfg.GetOrDefault(_cardId);
- _ui.m_loaBg.url = ResPathUtil.GetCardPath(cfg.Res);
- }
- protected override void OnHide()
- {
- base.OnHide();
- Timers.inst.Remove(OnTimerClick);
- _ui.m_loaBg.touchable = true;
- }
- protected override void RemoveEventListener()
- {
- base.RemoveEventListener();
- }
- private void OnTimerClick(object param)
- {
- _ui.m_loaBg.touchable = true;
- }
- private void OnClickBg()
- {
- if (!GetSuitItemController.isAuto)
- {
- this.Hide();
- }
- }
- private void OnClickShare()
- {
- ShareDataManager.Instance.CaptureCameraToImage();
- }
- }
- }
|