DailyTaskRewardView.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections.Generic;
  2. using FairyGUI;
  3. using UI.DailyTask;
  4. using UnityEngine;
  5. namespace GFGGame
  6. {
  7. public class DailyTaskRewardView : BaseWindow
  8. {
  9. private UI_DailyTaskRewardUI _ui;
  10. private List<FieldTaskCfg> _cfgs;
  11. public override void Dispose()
  12. {
  13. base.Dispose();
  14. }
  15. protected override void OnInit()
  16. {
  17. base.OnInit();
  18. _ui = UI_DailyTaskRewardUI.Create();
  19. this.viewCom = _ui.target;
  20. this.viewCom.Center();
  21. this.modal = true;
  22. viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
  23. _ui.m_list.itemRenderer = ListItemRender;
  24. }
  25. protected override void OnShown()
  26. {
  27. base.OnShown();
  28. _cfgs = FieldDataManager.Instance.GetTaskCfgs();
  29. _ui.m_list.numItems = _cfgs.Count;
  30. }
  31. protected override void OnHide()
  32. {
  33. base.OnHide();
  34. }
  35. private void ListItemRender(int index, GObject obj)
  36. {
  37. UI_ListItem item = UI_ListItem.Proxy(obj);
  38. UI_ListItem.ClearProxy();
  39. }
  40. }
  41. }