1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using FairyGUI;
- using System.Collections;
- using UI.Card;
- using UnityEngine;
- namespace GFGGame
- {
- public class CardShowView : BaseWindow
- {
- private UI_CardShowUI _ui;
- public override void 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();
- }
- }
- }
|