123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using FairyGUI;
- using System.Collections;
- using UI.Card;
- using UnityEngine;
- namespace GFGGame
- {
- public class CardShowView : BaseWindow
- {
- private UI_CardShowUI _ui;
- public override void Dispose()
- {
- _ui.m_loaCard.Dispose();
- if (_ui != null)
- {
- _ui.Dispose();
- _ui = null;
- }
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- _ui = UI_CardShowUI.Create();
- this.viewCom = _ui.target;
- isfullScreen = true;
- // viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
- this.modal = true;
- _ui.m_loaCard.onClick.Add(OnClickBtnBack);
- }
- protected override void OnShown()
- {
- base.OnShown();
- CardData cardData = (viewData as CardData);
- _ui.m_loaCard.url = ResPathUtil.GetCardPath(cardData.resources[cardData.resIndex]);
- _ui.m_loaCard.width = _ui.m_loaCard.image.width;
- _ui.target.scrollPane.SetPercX(0.5f, false);
- }
- private void OnClickBtnBack()
- {
- ViewManager.GoBackFrom(ViewName.CARD_SHOW_VIEW);
- EventAgent.DispatchEvent(ConstMessage.PLAT_CARDFOSTER_T1);
- _ui.target.scrollPane.SetPercX(0.5f, true);
- }
- protected override void OnHide()
- {
- base.OnHide();
- }
- }
- }
|