SpecificProfessionEquipmentPanel.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System.Collections.Generic;
  2. using Common.Utility.CombatEvent;
  3. using Fort23.Core;
  4. using Fort23.UTool;
  5. using GameLogic.Bag;
  6. using UnityEngine;
  7. namespace Fort23.Mono
  8. {
  9. [UIBinding(prefab = "SpecificProfessionEquipmentPanel" )]
  10. public partial class SpecificProfessionEquipmentPanel : UIPanel
  11. {
  12. private void Init()
  13. {
  14. }
  15. protected override void AddEvent()
  16. {
  17. }
  18. protected override void DelEvent()
  19. {
  20. }
  21. public override void AddButtonEvent()
  22. {
  23. btnBack.onClick.AddListener(OnclickClose);
  24. btnOnce.onClick.AddListener(OnclickOnce);
  25. }
  26. private bool isClickOnce = false;
  27. public int curZy;
  28. //流光溢彩 别出心裁 千篇一律 呕心沥血
  29. private void OnclickOnce()
  30. {
  31. isClickOnce = PlayerManager.Instance.eqController.EquipZyEqs(curZy);
  32. if (isClickOnce)
  33. {
  34. UIManager.Instance.DormancyAllGComponent<WidgetItem>("eq2");
  35. HeroUITools.UpdateZyEqIcon(curZy, eqs);
  36. }
  37. }
  38. private async void OnclickClose()
  39. {
  40. UIManager.Instance.HideUIUIPanel(this);
  41. UIManager.Instance.DormancyAllGComponent<WidgetItem>("eq2");
  42. if (isClickOnce)
  43. {
  44. UIManager.Instance.DormancyAllGComponent<WidgetItem>("eq");
  45. ProfessionEquipmentPanel professionEquipmentPanel = UIManager.Instance.GetComponent<ProfessionEquipmentPanel>();
  46. // ProfessionEquipmentPanel professionEquipmentPanel = await UIManager.Instance.LoadAndOpenPanel<ProfessionEquipmentPanel>(null);
  47. // professionEquipmentPanel.UpdateZyEqs(curZy);
  48. professionEquipmentPanel.UpdateAllEq();
  49. HeroPowerUpEventData data = new HeroPowerUpEventData();
  50. data.upType = HeroUpType.BasicEquip;
  51. EventManager.Instance.Dispatch(CustomEventType.HeroPowerUp, data);
  52. }
  53. }
  54. public void InitPanel(int zy)
  55. {
  56. isClickOnce = false;
  57. curZy = zy;
  58. HeroUITools.UpdateZyEqIcon(zy, eqs, poolName:"eq2");
  59. }
  60. }
  61. }