上海虹口龙之梦项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

39 lines
1.2 KiB

using AillieoUtils;
using System;
using UnityEngine.UI;
/// <summary>
/// 区域超员报警
/// </summary>
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>().text = data.Name;
item.Find("Sex").GetComponent<Text>().text = data.SexName;
item.Find("Job").GetComponent<Text>().text = data.PersonTypeName;
item.Find("TargetNo").GetComponent<Text>().text = data.DwbqNo;
item.Find("Date").GetComponent<Text>().text = DateTimeOffset.FromUnixTimeMilliseconds(data.AddDate).LocalDateTime.ToString();
});
scrollView.SetItemCountFunc(() => dataSource.PersonList.Count);
scrollView.UpdateData(false);
}
}