XiuFangView.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System.Collections;
  2. using UnityEngine;
  3. using UI.XiuFang;
  4. using FairyGUI;
  5. namespace GFGGame
  6. {
  7. public class XiuFangView : BaseWindow
  8. {
  9. private UI_XiuFangUI _ui;
  10. public override void Dispose()
  11. {
  12. base.Dispose();
  13. }
  14. protected override void OnInit()
  15. {
  16. base.OnInit();
  17. packageName = UI_XiuFangUI.PACKAGE_NAME;
  18. _ui = UI_XiuFangUI.Create();
  19. this.viewCom = _ui.target;
  20. isfullScreen = true;
  21. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  22. _ui.m_component.m_btnClothingShop.onClick.Add(OnClickBtnClothingShop);
  23. _ui.m_component.m_btnSuitSynthetic.onClick.Add(OnClickBtnSuitSynthetic);
  24. _ui.m_component.m_btnClothingUpgrade.onClick.Add(OnClickBtnClothingUpgrade);
  25. _ui.m_component.m_btnDecompose.onClick.Add(OnClickBtnDecompose);
  26. }
  27. protected override void OnShown()
  28. {
  29. base.OnShown();
  30. _ui.m_component.target.scrollPane.SetPosX(0, false);
  31. GuideController.TryGuideSuitSyntheticView(_ui.m_component.m_btnSuitSynthetic);
  32. }
  33. protected override void OnHide()
  34. {
  35. base.OnHide();
  36. }
  37. private void OnClickBtnBack()
  38. {
  39. this.Hide();
  40. ViewManager.GoBackFrom(ViewName.XIU_FANG_VIEW);
  41. }
  42. private void OnClickBtnClothingShop()
  43. {
  44. ViewManager.Show(ViewName.CLOTHING_SHOP_VIEW, null, new object[] { ViewName.XIU_FANG_VIEW, this.viewData }, false, true);
  45. this.Hide();
  46. }
  47. private void OnClickBtnSuitSynthetic()
  48. {
  49. ViewManager.Show(ViewName.SUIT_SYNTHETIC_LIST_VIEW, null, new object[] { ViewName.XIU_FANG_VIEW, this.viewData });
  50. }
  51. private void OnClickBtnClothingUpgrade()
  52. {
  53. PromptController.Instance.ShowFloatTextPrompt("暂未开放", MessageType.WARNING);
  54. }
  55. private void OnClickBtnDecompose()
  56. {
  57. ViewManager.Show<ClothingDecomposeView>(null, new object[] { ViewName.XIU_FANG_VIEW, this.viewData });
  58. }
  59. protected override void UpdateToCheckGuide(object param)
  60. {
  61. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  62. GuideController.TryGuide(_ui.m_component.m_btnSuitSynthetic, ConstGuideId.CLOTHING_SYNTHETIC, 6, "这里可以查看已获得的服饰图谱");
  63. }
  64. }
  65. }