CaveMainPanel.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using Core.Audio;
  2. using Fort23.Core;
  3. namespace Fort23.Mono
  4. {
  5. [UIBinding(prefab = "CaveMainPanel")]
  6. public partial class CaveMainPanel : UIPanel
  7. {
  8. private void Init()
  9. {
  10. isAddStack = true;
  11. IsShowAppBar = true;
  12. }
  13. protected override void AddEvent()
  14. {
  15. }
  16. protected override void DelEvent()
  17. {
  18. }
  19. public override void Hide()
  20. {
  21. base.Hide();
  22. AudioManager.Instance.PlayBGM("xunlongduobao.wav");
  23. }
  24. public override void AddButtonEvent()
  25. {
  26. Btn_DaoLv.onClick.AddListener(() => { ImmortalBondPanel.OpenPanel(); });
  27. Btn_XiuLian.onClick.AddListener(() => { HeroInformationPanel.OpenPanel(); });
  28. }
  29. public override CTask GetFocus()
  30. {
  31. AppBarPanel.OpenPanel(this);
  32. TitlePanel.OpenPanel();
  33. if (PlayerGuideManager.Instance.GuideIsCanDo(6, 1))
  34. {
  35. PlayerGuideManager.Instance.NextGuide();
  36. }
  37. return base.GetFocus();
  38. }
  39. public override CTask LoseFocus()
  40. {
  41. // TitlePanel.ClosePanel();
  42. return base.LoseFocus();
  43. }
  44. public async static CTask<CaveMainPanel> OpenPanel()
  45. {
  46. CaveMainPanel heroInformationPanel = await UIManager.Instance.LoadAndOpenPanel<CaveMainPanel>(null);
  47. AudioManager.Instance.PlayBGM("dongfu.mp3");
  48. return heroInformationPanel;
  49. }
  50. public async override CTask Close()
  51. {
  52. await UIManager.Instance.HideUIUIPanel<HeroInformationPanel>(isBreadcrumbBarPanel: false);
  53. await UIManager.Instance.HideUIUIPanel<HeroBreakthroughPanel>(isBreadcrumbBarPanel: false);
  54. await UIManager.Instance.HideUIUIPanel<SelectBreakthroughItemPanel>(isBreadcrumbBarPanel: false);
  55. await base.Close();
  56. }
  57. }
  58. }