StudioMetalView.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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.GetGroup1ByFunId(typeof(StudioMetalView).Name)[0];
  25. this.storyLevelCfgs = CommonDataManager.Tables.TblStoryLevelCfg.DataList
  26. .Where(a => a.Type == this._studioCfg.Type &&
  27. a.SubType == _studioCfg.SubType &&
  28. a.ChapterId == this._studioCfg.Id).ToList();
  29. list.numItems = this.storyLevelCfgs.Count;
  30. list.ScrollToView(curIndex);
  31. com.GetChild("loaBg").asLoader.url = ResPathUtil.GetBgImgPath("gzs_fb_bj");
  32. com.GetChild("Name").asLoader.url = "ui://Studio/gzs_fb_bt_jsxf";
  33. com.GetChild("btnChageLine").asLoader.url = ResPathUtil.GetCommonGameResPath("zsx_fl");
  34. base.OnShown();
  35. com.height = _ui.target.height;
  36. }
  37. protected override void OnHide()
  38. {
  39. base.OnHide();
  40. }
  41. private void OnClickBtnBack()
  42. {
  43. ViewManager.GoBackFrom(typeof(StudioMetalView).FullName);
  44. }
  45. }
  46. }