StudioPropertyView.cs 1.7 KB

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