ClothingSelectView.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System;
  2. using System.Collections.Generic;
  3. using ET;
  4. using FairyGUI;
  5. using UI.CommonGame;
  6. using UI.ClothingUpgrade;
  7. using UnityEngine;
  8. namespace GFGGame
  9. {
  10. public class ClothingSelectView : BaseWindow
  11. {
  12. private UI_ClothingSelectUI _ui;
  13. public override void Dispose()
  14. {
  15. base.Dispose();
  16. }
  17. protected override void OnInit()
  18. {
  19. base.OnInit();
  20. packageName = UI_ClothingSelectUI.PACKAGE_NAME;
  21. _ui = UI_ClothingSelectUI.Create();
  22. this.viewCom = _ui.target;
  23. isfullScreen = true;
  24. modal = true;
  25. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  26. _ui.m_selectList.itemRenderer = RenderListItem;
  27. }
  28. protected override void OnShown()
  29. {
  30. base.OnShown();
  31. UpdateList();
  32. }
  33. protected override void OnHide()
  34. {
  35. base.OnHide();
  36. }
  37. private void RenderListItem(int index, GObject obj)
  38. {
  39. UI_clothingSelectItem listItem = UI_clothingSelectItem.Proxy(obj);
  40. if (listItem.target.data == null)
  41. {
  42. listItem.target.onClick.Add(OnBtnItem);
  43. }
  44. listItem.target.data = index;
  45. UI_clothingSelectItem.ProxyEnd();
  46. }
  47. private void OnBtnItem(EventContext context)
  48. {
  49. GObject Item = context.sender as GObject;
  50. int partIndex = (int)Item.data;
  51. ViewManager.Show<ClothingUpgradeView>(new object[] {partIndex });
  52. }
  53. private void OnClickBtnBack()
  54. {
  55. ViewManager.GoBackFrom(typeof(ClothingSelectView).FullName);
  56. }
  57. private void UpdateList()
  58. {
  59. }
  60. }
  61. }