12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System.Collections;
- using UnityEngine;
- using UI.ActivityGetYuanXiao;
- using FairyGUI;
- using System.Collections.Generic;
- namespace GFGGame
- {
- public class ActivityGetYuanXiaoTaskView : BaseWindow
- {
- private UI_ActivityGetYuanXiaoTaskUI _ui;
- public override void Dispose()
- {
- if (_ui != null)
- {
- _ui.Dispose();
- _ui = null;
- }
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_ActivityGetYuanXiaoTaskUI.PACKAGE_NAME;
- _ui = UI_ActivityGetYuanXiaoTaskUI.Create();
- viewCom = _ui.target;
- viewCom.Center();
- viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
- modal = true;
- _ui.m_itemList.itemRenderer = ListRenderer;
- }
- protected override void OnShown()
- {
- base.OnShown();
- _ui.m_itemList.numItems = PickUpGameArray.Instance.dataArray.Length;
- _ui.m_itemList.scrollPane.ScrollTop();
- }
- private void ListRenderer(int index, GObject gObject)
- {
- UI_taskItem item = UI_taskItem.Proxy(gObject);
- item.m_c1.selectedIndex = 0;
- item.m_desc.text = "";
- item.m_rewardList.data = index;
- List<ItemData> itemDatas = ItemUtil.CreateItemDataList(PickUpGameArray.Instance.dataArray[index].bonusWinArr);
- item.m_rewardList.numItems = itemDatas.Count;
- for (int i = 0; i < itemDatas.Count; i++)
- {
- GObject obj = item.m_rewardList.GetChildAt(i);
- ItemData reward = itemDatas[i];
- if (obj.data == null)
- {
- obj.data = new ItemView(obj as GComponent);
- }
- (obj.data as ItemView).SetData(reward);
- }
- UI_taskItem.ProxyEnd();
- }
- }
- }
|