MatchingCompetitionWorkListView.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System;
  2. using System.Collections.Generic;
  3. using ET;
  4. using FairyGUI;
  5. using UI.MatchingCompetition;
  6. using UnityEngine;
  7. namespace GFGGame
  8. {
  9. class MatchingCompetitionWorksListView : BaseWindow
  10. {
  11. private UI_MatchingCompetitionWorkListUI _ui;
  12. private int _seasonIndex = 0;
  13. public override void Dispose()
  14. {
  15. if (_ui != null)
  16. {
  17. _ui.Dispose();
  18. }
  19. _ui = null;
  20. base.Dispose();
  21. }
  22. protected override void OnInit()
  23. {
  24. base.OnInit();
  25. packageName = UI_MatchingCompetitionWorkListUI.PACKAGE_NAME;
  26. _ui = UI_MatchingCompetitionWorkListUI.Create();
  27. this.viewCom = _ui.target;
  28. isReturnView = true;
  29. isfullScreen = true;
  30. _ui.m_workList.itemRenderer = RenderRankList;
  31. _ui.m_BtnBack.onClick.Add(OnClickBtnBack);
  32. }
  33. protected override void AddEventListener()
  34. {
  35. base.AddEventListener();
  36. }
  37. protected override void OnShown()
  38. {
  39. base.OnShown();
  40. _ui.m_bg.url = ResPathUtil.GetBgImgPath("gzs_fb_bj");
  41. _seasonIndex = (int)this.viewData;
  42. UpdateView();
  43. }
  44. protected override void OnHide()
  45. {
  46. base.OnHide();
  47. }
  48. protected override void RemoveEventListener()
  49. {
  50. base.RemoveEventListener();
  51. }
  52. private void UpdateView()
  53. {
  54. _ui.m_workList.numItems = 2;
  55. }
  56. private void RenderRankList(int index, GObject obj)
  57. {
  58. UI_Component6 item = UI_Component6.Proxy(obj);
  59. if((index +1) >=1 && (index + 1)<=3)
  60. {
  61. item.m_c1.selectedIndex = index + 1;
  62. }
  63. else
  64. {
  65. item.m_c1.selectedIndex = 0;
  66. }
  67. UI_Component6.ProxyEnd();
  68. }
  69. private void OnClickBtnBack()
  70. {
  71. ViewManager.GoBackFrom(typeof(MatchingCompetitionWorksListView).FullName);
  72. }
  73. }
  74. }