EqRecyclePanel.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System.Collections.Generic;
  2. using Fort23.UTool;
  3. using GameLogic.Bag;
  4. namespace Fort23.Mono
  5. {
  6. [UIBinding(prefab = "EqRecyclePanel" )]
  7. public partial class EqRecyclePanel : UIPanel
  8. {
  9. private string poolName = "eqItem";
  10. private void Init()
  11. {
  12. }
  13. protected override void AddEvent()
  14. {
  15. }
  16. protected override void DelEvent()
  17. {
  18. }
  19. public override void AddButtonEvent()
  20. {
  21. btnBack.onClick.AddListener(OnclickClose);
  22. }
  23. private void OnclickClose()
  24. {
  25. UIManager.Instance.HideUIUIPanel(this);
  26. UIManager.Instance.DormancyAllGComponent<WidgetItem>(poolName);
  27. }
  28. public async void InitEqRecyclePanel()
  29. {
  30. // GameObject eqGo = eqsUIObj[0] as GameObject;
  31. foreach (KeyValuePair<int,Dictionary<int,List<ItemInfo>>> keyValuePair in PlayerManager.Instance.eqController.allZyEqDic)
  32. {
  33. foreach (KeyValuePair<int,List<ItemInfo>> valuePair in keyValuePair.Value)
  34. {
  35. foreach (ItemInfo itemInfo in valuePair.Value)
  36. {
  37. if (itemInfo.eqInfo == null)
  38. {
  39. continue;
  40. }
  41. if (itemInfo.count.Value == 0)
  42. {
  43. LogTool.Log("装备只有1个,而且被穿了:" + itemInfo.eqInfo.isEquip);
  44. if (!itemInfo.eqInfo.isEquip)
  45. {
  46. LogTool.Log("不应该出现,数量为0的装备还未穿戴?需要检查:eqConfigID"
  47. + itemInfo.eqInfo.basicEquipConfig.ID
  48. + "| itemID:" + itemInfo.itemID
  49. + "| guid:" + itemInfo.guid);
  50. }
  51. continue;
  52. }
  53. WidgetItem widgetItem = await UIManager.Instance.
  54. CreateGComponentForObject<WidgetItem>(eqItem, null, isInstance : true,
  55. poolName:poolName, root:itemRoot);
  56. widgetItem.InitWidget(itemInfo);
  57. }
  58. }
  59. }
  60. }
  61. }
  62. }