예제 #1
0
        private void UpdateItem(T data)
        {
            ListItemView <T> view = views.Find(itemView => itemView.data.id == data.id);

            if (view)
            {
                view.Setup(data);
            }
        }
예제 #2
0
        private void AddItem(T data)
        {
            GameObject       go       = Instantiate(itemPrefab);
            ListItemView <T> itemView = go.GetComponentInChildren <ListItemView <T> >();

            go.transform.SetParent(layout, false);
            itemView.Setup(data);
            views.Add(itemView);
        }
예제 #3
0
        private bool HasItem(T data)
        {
            ListItemView <T> view = views.Find(itemView => itemView.data.id == data.id);

            if (view)
            {
                return(true);
            }
            return(false);
        }
예제 #4
0
        private void RemoveItem(T data)
        {
            ListItemView <T> view = views.Find(itemView => itemView.data.id == data.id);

            if (view)
            {
                views.Remove(view);
                Destroy(view.gameObject);
            }
        }