/// #pkgName FGUI包名 /// #panelName UIPanel名字 /// #UIName = $"{#pkgName}{#panelName}" UIKey名字 /// 该脚本由模板创建 /// created by cb 2024 using System.Collections.Generic; using FairyGUI; using FL.Data; using XGame.Database; using XGame.Framework.UI; namespace FL.FGUI { /// /// UI逻辑处理类 /// /// public partial class PartnerBookAddDetailPanelCtrl : UIController { protected override void OnEnable(object intent) { AddUIListenres(); _type = (int)intent; } protected override void OnDisable() { RemoveUIListenres(); } #region UI事件 private void AddUIListenres() { } private void RemoveUIListenres() { } #endregion private int _type; private void ShowUI() { var addMap = new Dictionary(); foreach (var item in PartnersData.Instance.JibanMap) { var table = collect_rewardTableRepo.Get(item.Key); if (table == null) continue; var collectTable = collectTableRepo.Get(table.CollectId); XGame.Framework.Assert.IsNotNull(collectTable, $"羁绊不存在,id{table.CollectId}"); if (collectTable.Type != _type) continue; //for(int i=0;i < table.Attribute.Length, i += 2) //{ // if (addMap.TryGetValue(table.Attribute[i], out var add)) // { // addMap.Remove(table.Attribute[i]); // } // addMap.Add(table.Attribute[i], add + table.Attribute[i+1]); //} } var list = new List(); foreach (var item in addMap) { list.Add(new PartnerBookAttrTextParam() { AttrId = item.Key, Val = item.Value }); } VM.List.BindDatas(list); } } }