12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- 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);
- }
- private void OnclickClose()
- {
- UIManager.Instance.HideUIUIPanel(this);
- }
- public void InitPanel(int zy)
- {
- SetEqs(zy);
- }
-
- private async void SetEqs(int zy)
- {
- foreach (GameObject eqGo in eqs)
- {
- WidgetItem eqItem = await UIManager.Instance.
- CreateGComponentForObject<WidgetItem>(eqGo,
- null, root:eqGo.GetComponent<RectTransform>());
- LogTool.Log(eqGo + "设置");
- eqItem.SetEmpty();
- }
- if (BagController.Instance.EqDic.ContainsKey(zy))
- {
- 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);
- }
- }
- }
- }
- }
- }
|