123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- using System.Collections.Generic;
- using Common.Utility.CombatEvent;
- using Core.Language;
- 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.QuickEquip(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;
- SetZyInfo();
- HeroUITools.UpdateZyEqIcon(zy, eqs, poolName:"eq2");
- }
- private void SetZyInfo()
- {
- switch (curZy)
- { //
- case 1:
- SetZyTxt(97);
- zyBg.icon_name = "bg_warrior";
- colorBg.color = new Color(255, 215, 0);
- break;
- case 2:
- SetZyTxt(98);
- zyBg.icon_name = "bg_priest";
- colorBg.color = new Color(128, 0, 128);
- break;
- case 3:
- SetZyTxt(99);
- zyBg.icon_name = "bg_Mage";
- colorBg.color = new Color(255, 255, 204);
- break;
- case 4:
- SetZyTxt(100);
- zyBg.icon_name = "bg_Archer";
- colorBg.color = new Color(0, 128, 0);
- break;
- default:
- break;
- }
- }
- private void SetZyTxt(int languageId)
- {
- zyTitle.text = LanguageManager.Instance.Text(languageId);
- miniTitle.text = LanguageManager.Instance.Text(languageId);
- }
- private void SetZyBg(int zy)
- {
- }
- }
- }
|