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("eq2"); HeroUITools.UpdateZyEqIcon(curZy, eqs); } } private async void OnclickClose() { UIManager.Instance.HideUIUIPanel(this); UIManager.Instance.DormancyAllGComponent("eq2"); if (isClickOnce) { UIManager.Instance.DormancyAllGComponent("eq"); ProfessionEquipmentPanel professionEquipmentPanel = UIManager.Instance.GetComponent(); // ProfessionEquipmentPanel professionEquipmentPanel = await UIManager.Instance.LoadAndOpenPanel(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"); } } }