PartnerBookAddDetailPanelCtrl.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /// #pkgName FGUI包名
  2. /// #panelName UIPanel名字
  3. /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
  4. /// 该脚本由模板创建
  5. /// created by cb 2024
  6. using System.Collections.Generic;
  7. using FairyGUI;
  8. using FL.Data;
  9. using XGame.Database;
  10. using XGame.Framework.UI;
  11. namespace FL.FGUI
  12. {
  13. /// <summary>
  14. /// UI逻辑处理类
  15. /// </summary>
  16. /// <typeparam name=""></typeparam>
  17. public partial class PartnerBookAddDetailPanelCtrl : UIController<PartnerBookAddDetailPanelVM>
  18. {
  19. protected override void OnEnable(object intent)
  20. {
  21. AddUIListenres();
  22. _type = (int)intent;
  23. }
  24. protected override void OnDisable()
  25. {
  26. RemoveUIListenres();
  27. }
  28. #region UI事件
  29. private void AddUIListenres() { }
  30. private void RemoveUIListenres() { }
  31. #endregion
  32. private int _type;
  33. private void ShowUI()
  34. {
  35. var addMap = new Dictionary<int, int>();
  36. foreach (var item in PartnersData.Instance.JibanMap)
  37. {
  38. var table = collect_rewardTableRepo.Get(item.Key);
  39. if (table == null)
  40. continue;
  41. var collectTable = collectTableRepo.Get(table.CollectId);
  42. XGame.Framework.Assert.IsNotNull(collectTable, $"羁绊不存在,id{table.CollectId}");
  43. if (collectTable.Type != _type) continue;
  44. //for(int i=0;i < table.Attribute.Length, i += 2)
  45. //{
  46. // if (addMap.TryGetValue(table.Attribute[i], out var add))
  47. // {
  48. // addMap.Remove(table.Attribute[i]);
  49. // }
  50. // addMap.Add(table.Attribute[i], add + table.Attribute[i+1]);
  51. //}
  52. }
  53. var list = new List<PartnerBookAttrTextParam>();
  54. foreach (var item in addMap)
  55. {
  56. list.Add(new PartnerBookAttrTextParam() { AttrId = item.Key, Val = item.Value });
  57. }
  58. VM.List.BindDatas(list);
  59. }
  60. }
  61. }