StudioPropertyView.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using FairyGUI;
  2. using UI.Studio;
  3. namespace GFGGame
  4. {
  5. public class StudioPropertyView : StudioBaseView
  6. {
  7. public override void Dispose()
  8. {
  9. base.Dispose();
  10. }
  11. protected override void OnInit()
  12. {
  13. base.OnInit();
  14. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  15. _ui.m_listProperty.itemRenderer = ListPropertyItemRender;
  16. _ui.m_listProperty.onClickItem.Add(OnClickListProperty);
  17. }
  18. protected override void OnShown()
  19. {
  20. base.OnShown();
  21. _ui.m_c1.selectedIndex = 1;
  22. this.studioCfgs = StudioDataManager.Instance.GetStudioCfgListByViewName(typeof(StudioPropertyView).FullName);
  23. _ui.m_listProperty.numItems = this.studioCfgs.Count;
  24. }
  25. protected override void OnHide()
  26. {
  27. base.OnHide();
  28. }
  29. private void OnClickBtnBack()
  30. {
  31. ViewManager.GoBackFrom(typeof(StudioPropertyView).FullName);
  32. }
  33. private void ListPropertyItemRender(int index, GObject obj)
  34. {
  35. UI_ListPropertyItem item = UI_ListPropertyItem.Proxy(obj);
  36. item.target.data = this.studioCfgs[index];
  37. }
  38. private void OnClickListProperty(EventContext context)
  39. {
  40. UI_ListPropertyItem item = UI_ListPropertyItem.Proxy(context.data as GObject);
  41. StudioCfg cfg = item.target.data as StudioCfg;
  42. }
  43. }
  44. }