StudioMetalView.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using FairyGUI;
  4. using UI.Studio;
  5. namespace GFGGame
  6. {
  7. //金属副本
  8. public class StudioMetalView : StudioBaseView
  9. {
  10. public override void Dispose()
  11. {
  12. base.Dispose();
  13. }
  14. protected override void OnInit()
  15. {
  16. base.OnInit();
  17. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  18. }
  19. protected override void OnShown()
  20. {
  21. GComponent com = UIPackage.CreateObject(UI_StudioUI.PACKAGE_NAME, "ComFabric").asCom;
  22. AddChildCom(com);
  23. StudioDataManager.Instance.VIEW_NAME = typeof(StudioMetalView).FullName;
  24. this._studioCfg = CommonDataManager.Tables.TblStudioCfg.DataList
  25. .Where(a => a.FunId == typeof(StudioMetalView).Name).ToList()[0];
  26. this.storyLevelCfgs = CommonDataManager.Tables.TblStoryLevelCfg.DataList
  27. .Where(a => a.Type == this._studioCfg.Type &&
  28. a.SubType == _studioCfg.SubType &&
  29. a.ChapterId == this._studioCfg.Id).ToList();
  30. list.numItems = this.storyLevelCfgs.Count;
  31. list.ScrollToView(curIndex);
  32. com.GetChild("loaBg").asLoader.url = ResPathUtil.GetBgImgPath("gzs_fb_bj");
  33. com.GetChild("Name").asLoader.url = "ui://Studio/gzs_fb_bt_jsxf";
  34. com.GetChild("btnChageLine").asLoader.url = ResPathUtil.GetCommonGameResPath("zsx_fl");
  35. base.OnShown();
  36. com.height = _ui.target.height;
  37. }
  38. protected override void OnHide()
  39. {
  40. base.OnHide();
  41. }
  42. private void OnClickBtnBack()
  43. {
  44. ViewManager.GoBackFrom(typeof(StudioMetalView).FullName);
  45. }
  46. }
  47. }