12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- using System.Collections.Generic;
- 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 void OnclickOnce()
- {
- PlayerManager.Instance.eqController.EquipZyEqs(curZy);
- HeroUITools.UpdateZyEqIcon(curZy, eqs);
- }
- private void OnclickClose()
- {
- UIManager.Instance.HideUIUIPanel(this);
- }
- public void InitPanel(int zy)
- {
- // SetEqs(zy);
- curZy = zy;
- HeroUITools.UpdateZyEqIcon(zy, eqs, 30);
- }
- public int curZy;
- private async void SetEqs(int zy)
- {
- curZy = zy;
- // foreach (GameObject eqGo in eqs)
- // {
- // WidgetItem eqItem = await UIManager.Instance.
- // CreateGComponentForObject<WidgetItem>(eqGo,
- // null, root:eqGo.GetComponent<RectTransform>());
- // LogTool.Log(eqGo + "设置");
- // eqItem.SetEmpty();
- // }
-
- HeroUITools.UpdateZyEqIcon(zy, eqs, 30);
- // if (PlayerManager.Instance.eqController.zyEqDic.TryGetValue(zy, out Dictionary<int ,List<ItemInfo>> bwDic))
- // {
- // foreach (KeyValuePair<int,List<ItemInfo>> keyValuePair in bwDic)
- // {
- // //遍历每个部位下的全部装备
- // foreach (ItemInfo eqInfo in keyValuePair.Value)
- // {
- // if (eqInfo.eqInfo.isEquip)
- // {
- // GameObject eqGo = eqs[keyValuePair.Key - 1] as GameObject;
- // WidgetItem eqItem = await UIManager.Instance.
- // CreateGComponentForObject<WidgetItem>(eqGo, null, root:eqGo.GetComponent<RectTransform>());
- // eqItem.InitWidget(eqInfo);
- // }
- // }
- // }
- // }
-
- // if (PlayerManager.Instance.eqController.zyEqDic.TryGetValue(zy, out var bwDic))
- // {
- // List<ItemInfo> eqList = BagController.Instance.EqDic[zy];
- // foreach (ItemInfo eqInfo in eqList)
- // {
- // if (eqInfo.eqInfo.isEquip)
- // {
- // // if(eqInfo.eqInfo.basicEquipConfig.Type)
- // GameObject eqGo = eqs[eqInfo.eqInfo.basicEquipConfig.Type - 1] as GameObject;
- // WidgetItem eqItem = await UIManager.Instance.
- // CreateGComponentForObject<WidgetItem>(eqGo, null, root:eqGo.GetComponent<RectTransform>());
- // eqItem.InitWidget(eqInfo);
- // }
- // }
- // }
- }
- }
- }
|