using AillieoUtils; using System; using UnityEngine.UI; /// /// 区域超员报警 /// public class AreaOverloadPanel : UIView { public ScrollView scrollView; public Button closeButton; public override void Awake() { base.Awake(); closeButton.onClick.AddListener(()=>Hide()); } public void SetData(Alarm dataSource) { if (dataSource.PersonList.Count <= 0 || dataSource.PersonList == null) return; scrollView.SetUpdateFunc((index, item) => { var data = dataSource.PersonList[index]; item.gameObject.SetActive(true); item.Find("Name").GetComponent().text = data.Name; item.Find("Sex").GetComponent().text = data.SexName; item.Find("Job").GetComponent().text = data.PersonTypeName; item.Find("TargetNo").GetComponent().text = data.DwbqNo; item.Find("Date").GetComponent().text = DateTimeOffset.FromUnixTimeMilliseconds(data.AddDate).LocalDateTime.ToString(); }); scrollView.SetItemCountFunc(() => dataSource.PersonList.Count); scrollView.UpdateData(false); } }