Beispiel #1
0
    /// <summary>
    /// 移除选中人员的项
    /// </summary>
    public void SetSelectPersonnelItemToggle(Personnel personnelT, bool b)
    {
        List <HistoryPersonsSearchUIItem> pList = new List <HistoryPersonsSearchUIItem>(personsGrid.GetComponentsInChildren <HistoryPersonsSearchUIItem>());
        HistoryPersonsSearchUIItem        item  = pList.Find((i) => i.personnel == personnelT);

        //HistoryPersonsSearchUIItem item = selectPersonnelList.Find((i) => i.personnel == personnelT);
        if (!b)
        {
            if (item != null)
            {
                item.SetToggle(false);
            }
            else
            {
                RemoveSelectPersonnelItem(personnelT);
            }
        }
    }
Beispiel #2
0
    /// <summary>
    /// 创建人员列表
    /// </summary>
    public void CreatePersonsGrid()
    {
        ClearPersonItems();
        int startIndex = currentPageNum * showCount;
        int num        = showCount;

        if (startIndex + num > searchPersonnels.Count)
        {
            num = searchPersonnels.Count - startIndex;
        }
        if (searchPersonnels.Count == 0)
        {
            return;
        }
        List <Personnel> personnelsT = searchPersonnels.GetRange(startIndex, num);

        foreach (Personnel p in personnelsT)
        {
            //HistoryPersonsSearchUIItem item = selectPersonnelList.Find((i) => i.personnel == p);
            //if (item != null)
            //{
            //    item.gameObject.SetActive(true);
            //    item.transform.SetAsLastSibling();
            //    continue;
            //}
            HistoryPersonsSearchUIItem item = CreatePersonItem(p);
            Personnel pt = currentSelectPersonnels.Find((it) => it.Id == p.Id);
            if (pt != null)
            {
                item.SetToggle(true);
            }

            item.gameObject.SetActive(true);
            //personItemList.Add(item);
        }
    }