Пример #1
0
        public void RemoveItem(int columnIndex, int itemIndex)
        {
            MassivePickerScrollRect scrollRect = GetPickerScrollRect(columnIndex);

            if (scrollRect == null)
            {
                return;
            }

            itemList[columnIndex].items.RemoveAt(itemIndex);
            scrollRect.UpdateAllItemContent();
        }
Пример #2
0
        public void SetItems(int columnIndex, IList <ItemParamType> itemParams, bool fromInspector = false)
        {
            MassivePickerScrollRect scroll = GetPickerScrollRect(columnIndex);

            if (scroll == null)
            {
                return;
            }

            if (!fromInspector)
            {
                itemList[columnIndex].items = itemParams.ToList();
            }

            scroll.itemSize  = itemSize;
            scroll.itemCount = itemList[columnIndex].items.Count;
            scroll.UpdateAllItemContent();
        }
Пример #3
0
        public void AddItem(int columnIndex, ItemParamType param)
        {
            if (itemList == null)
            {
                return;
            }

            if (columnIndex < 0 || itemList.Count <= columnIndex)
            {
                throw new System.ArgumentOutOfRangeException();
            }

            itemList[columnIndex].items.Add(param);

            MassivePickerScrollRect scroll = GetPickerScrollRect(columnIndex);

            ++scroll.itemCount;

            scroll.UpdateAllItemContent();
        }