1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- using UnityEngine;
- using FairyGUI;
- using UI.Notice;
- namespace GFGGame
- {
- public class NoticeView : BaseWindow
- {
- private UI_NoticeUI _ui;
- public override void Dispose()
- {
- base.Dispose();
- }
- protected override void Init()
- {
- base.Init();
- packageName = UI_NoticeUI.PACKAGE_NAME;
- _ui = UI_NoticeUI.Create();
- this.viewCom = _ui.target;
- this.viewCom.Center();
- this.modal = true;
- viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
- }
- protected override void OnInit()
- {
- base.OnInit();
- _ui.m_listActivity.itemRenderer = ListActivityItemRender;
- _ui.m_listActivity.onClick.Add(OnListActivityClick);
- _ui.m_listNotice.itemRenderer = ListNoticeItemRender;
- }
- protected override void OnShown()
- {
- base.OnShown();
- _ui.m_listActivity.visible = true;
- _ui.m_listNotice.visible = true;
- }
- protected override void OnHide()
- {
- base.OnHide();
- }
- private void ListActivityItemRender(int index, GObject obj)
- {
- UI_ListActivityItem item = UI_ListActivityItem.Proxy(obj);
- item.m_loaShow.url = ResPathUtil.GetActivityPath("");
- item.target.data = index;
- }
- private void OnListActivityClick(EventContext context)
- {
- _ui.m_listActivity.visible = false;
- _ui.m_listNotice.visible = false;
- //(context.data as GObject).data
- ViewManager.Show<NoticeActivityShowView>(null, new object[] { typeof(NoticeView).Name, this.viewData });
- }
- private void ListNoticeItemRender(int index, GObject obj)
- {
- UI_ListNoticeItem item = UI_ListNoticeItem.Proxy(obj);
- if (item.m_btnGo.data == null)
- {
- item.m_btnGo.onClick.Add(OnListNoticeBtnGoClick);
- }
- }
- private void OnListNoticeBtnGoClick(EventContext context)
- {
- _ui.m_listActivity.visible = false;
- _ui.m_listNotice.visible = false;
- //(context.data as GObject).data
- ViewManager.Show<NoticeSystemShowView>(null, new object[] { typeof(NoticeView).Name, this.viewData });
- }
- }
- }
|