StudioFabricView.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System.Collections.Generic;
  2. using FairyGUI;
  3. using UI.Studio;
  4. namespace GFGGame
  5. {
  6. //织物副本
  7. public class StudioFabricView : StudioBaseView
  8. {
  9. public override void Dispose()
  10. {
  11. base.Dispose();
  12. }
  13. protected override void OnInit()
  14. {
  15. base.OnInit();
  16. packageName = UI_StudioEctypeUI.PACKAGE_NAME;
  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(StudioFabricView).FullName;
  24. this._studioCfg = StudioCfgArray.Instance.GetCfgsByfunId(typeof(StudioFabricView).Name)[0];
  25. this.storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgsBytypeAndsubTypeAndchapterId(this._studioCfg.type, this._studioCfg.subType, this._studioCfg.id);
  26. list.numItems = this.storyLevelCfgs.Count;
  27. list.ScrollToView(curIndex);
  28. base.OnShown();
  29. com.GetChild("loaBg").asLoader.url = ResPathUtil.GetBgImgPath("gzs_fb_bj");
  30. com.GetChild("Name").asLoader.url = "ui://Studio/gzs_fb_bt_zwxf";
  31. com.GetChild("btnChageLine").asLoader.url = ResPathUtil.GetCommonGameResPath("zsx_fl");
  32. com.height = _ui.target.height;
  33. }
  34. protected override void OnHide()
  35. {
  36. base.OnHide();
  37. }
  38. private void OnClickBtnBack()
  39. {
  40. ViewManager.GoBackFrom(typeof(StudioFabricView).FullName);
  41. }
  42. }
  43. }