using System.Collections.Generic; using System.Linq; using Excel2Json; using Fort23.Core; using Fort23.UTool; using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical; using UnityEngine; namespace Fort23.Mono { [UIBinding(prefab = "XianTuLogPanel")] public partial class XianTuLogPanel : UIPanel, IScrollListContent { List xianTuLogConfigs = new List(); List shoeXianTuLogConfigs = new List(); private void Init() { isAddStack = true; IsShowAppBar = false; } protected override void AddEvent() { } protected override void DelEvent() { } public override void AddButtonEvent() { Btn_Close.onClick.AddListener(() => { UIManager.Instance.HideUIUIPanel(this); }); } public override CTask AsyncInit(object[] uiData) { xianTuLogConfigs = ConfigComponent.Instance.GetAll().ToList(); shoeXianTuLogConfigs = GetTypeXiantuLogConfigs(1); Content.Init(this, shoeXianTuLogConfigs.Count); return base.AsyncInit(uiData); } private List GetTypeXiantuLogConfigs(int type) { List xiaNTYULogConfigs = new List(); foreach (var xianTuLogConfig in xianTuLogConfigs) { if (xianTuLogConfig.EventType == type) { xiaNTYULogConfigs.Add(xianTuLogConfig); } } return xiaNTYULogConfigs; } public async CTask GetIScorllListWidget(int index, RectTransform root) { if (index < 0 || index >= shoeXianTuLogConfigs.Count) { return null; } MainEventLogWidget mainEventLogWidget = await UIManager.Instance.CreateGComponent(null, Content.GetComponent()); mainEventLogWidget.CustomInit(shoeXianTuLogConfigs[index]); return mainEventLogWidget; } public void HindIScorllListWidget(IScorllListWidget widget) { UIManager.Instance.DormancyGComponent(widget as UIComponent); } public async static CTask OpenPanel() { XianTuLogPanel xianTuLogPanel = await UIManager.Instance.LoadAndOpenPanel(null); } } }