private void Add(ItemThings itemThings)
    {
        if (listPool.Find(item => item == itemThings) == null)
        {
            listPool.Add(itemThings);
        }

        UpdateList();
    }
    private void InitItemsThings(int count)
    {
        listItemThings = new List <ItemThings>();

        for (int i = 0; i < count; i++)
        {
            ItemThings itemThings = Instantiate(prefabItem, transform);
            itemThings.SetImage(IconManager.GetRandomSprite1x1());
            listItemThings.Add(itemThings);
        }

        listPool = new List <ItemThings>(listItemThings);
    }
    private void UpdateList()
    {
        ItemThings itemThings = listPool.Find(item => item.ItemCaseParent != null);

        if (itemThings != null)
        {
            listPool.Remove(itemThings);
        }

        if (listPool.Count == 0)
        {
            //TODO
            EventManager.OnShowButtonGo(true);
        }
        else
        {
            EventManager.OnShowButtonGo(false);
        }
    }
示例#4
0
    public void OnDrop(PointerEventData eventData)
    {
        if (eventData.pointerDrag != null)
        {
            if (!isBusy)
            {
                SetBusy(true);

                ItemThings itemThings = eventData.pointerDrag.GetComponent <ItemThings>();

                itemThings.SetParent(rectTransform);
                itemThings.SetItemCase(this);
                //?
                SetModeItemCase(ModeItemCase.Added);

                // Update ListItemThings
                EventManager.OnUpdateListThings();
            }
        }
    }
示例#5
0
    public static void OnAddedItemThings(ItemThings itemThings)
    {
        Action <ItemThings> tmp = AddedItemThings;

        tmp?.Invoke(itemThings);
    }