StudioFabricView.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using FairyGUI;
  4. using UI.Studio;
  5. namespace GFGGame
  6. {
  7. //织物副本
  8. public class StudioFabricView : StudioBaseView
  9. {
  10. public override void Dispose()
  11. {
  12. base.Dispose();
  13. }
  14. protected override void OnInit()
  15. {
  16. base.OnInit();
  17. packageName = UI_StudioEctypeUI.PACKAGE_NAME;
  18. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  19. }
  20. protected override void OnShown()
  21. {
  22. GComponent com = UIPackage.CreateObject(UI_StudioUI.PACKAGE_NAME, "ComFabric").asCom;
  23. AddChildCom(com);
  24. StudioDataManager.Instance.VIEW_NAME = typeof(StudioFabricView).FullName;
  25. this._studioCfg = CommonDataManager.Tables.TblStudioCfg.GetGroup1ByFunId(typeof(StudioFabricView).Name)[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. base.OnShown();
  33. com.GetChild("loaBg").asLoader.url = ResPathUtil.GetBgImgPath("gzs_fb_bj");
  34. com.GetChild("Name").asLoader.url = "ui://Studio/gzs_fb_bt_zwxf";
  35. com.GetChild("btnChageLine").asLoader.url = ResPathUtil.GetCommonGameResPath("zsx_fl");
  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(StudioFabricView).FullName);
  45. }
  46. }
  47. }