1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using System.Collections.Generic;
- using Common.Utility.CombatEvent;
- using Fort23.Core;
- using Fort23.UTool;
- using GameLogic.Bag;
- using UnityEngine;
- namespace Fort23.Mono
- {
- [UIBinding(prefab = "SpecificProfessionEquipmentPanel" )]
- public partial class SpecificProfessionEquipmentPanel : UIPanel
- {
- private void Init()
- {
- }
- protected override void AddEvent()
- {
- }
- protected override void DelEvent()
- {
- }
- public override void AddButtonEvent()
- {
- btnBack.onClick.AddListener(OnclickClose);
- btnOnce.onClick.AddListener(OnclickOnce);
- }
- private bool isClickOnce = false;
- public int curZy;
-
- private void OnclickOnce()
- {
- isClickOnce = PlayerManager.Instance.eqController.EquipZyEqs(curZy);
- if (isClickOnce)
- {
- UIManager.Instance.DormancyAllGComponent<WidgetItem>("eq2");
- HeroUITools.UpdateZyEqIcon(curZy, eqs);
- }
- }
- private async void OnclickClose()
- {
- UIManager.Instance.HideUIUIPanel(this);
- UIManager.Instance.DormancyAllGComponent<WidgetItem>("eq2");
- if (isClickOnce)
- {
- UIManager.Instance.DormancyAllGComponent<WidgetItem>("eq");
- ProfessionEquipmentPanel professionEquipmentPanel = UIManager.Instance.GetComponent<ProfessionEquipmentPanel>();
-
- // ProfessionEquipmentPanel professionEquipmentPanel = await UIManager.Instance.LoadAndOpenPanel<ProfessionEquipmentPanel>(null);
- // professionEquipmentPanel.UpdateZyEqs(curZy);
- professionEquipmentPanel.UpdateAllEq();
-
- HeroPowerUpEventData data = new HeroPowerUpEventData();
- data.upType = HeroUpType.BasicEquip;
-
- EventManager.Instance.Dispatch(CustomEventType.HeroPowerUp, data);
- }
- }
- public void InitPanel(int zy)
- {
- isClickOnce = false;
- curZy = zy;
- HeroUITools.UpdateZyEqIcon(zy, eqs, poolName:"eq2");
- }
-
- }
- }
|