using AillieoUtils; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; /// /// 人员定位面板 /// public class PersonnelLocationPanel : UIView { public ScrollView alarmScrollView; public ScrollView employeeScrollView; public List locationCards = new List(); public List items = new List(); public Toggle showAll; public override void Awake() { base.Awake(); showAll.onValueChanged.AddListener(v => Main.Event.EmployeeItemActive(v)); LoadTags(Config.Tags); } private void LoadTags(List tags) { employeeScrollView.SetUpdateFunc((index, item) => { string info = tags[index]; item.gameObject.SetActive(true); item.name = info; item.GetComponent().targetNo=long.Parse(info); item.transform.Find("CardNumber").GetComponent().text=info; locationCards.Add(item.gameObject); items.Add(item.GetComponent()); item.Find("Show").GetComponent().onValueChanged.AddListener(v => Main.Event.EmployeeActive(long.Parse(info), v)); item.Find("Track").GetComponent().onValueChanged.AddListener(v => Main.LocationSimulator.GetTrackPlaybackData(v, long.Parse(info))); }); employeeScrollView.SetItemCountFunc(() => tags.Count); employeeScrollView.UpdateData(false); } }