Пример #1
0
    public void SwapItem(IInventoryItem item)
    {
        mItems.Remove(item);
        item.OnSwap();

        CircleCollider2D collider = (item as MonoBehaviour).GetComponent <CircleCollider2D>();

        if (collider != null)
        {
            //collider.enabled = false;
            mItems.Clear();
            mItems.Add(item);
            item.OnPickup();
            if (ItemAdded != null)
            {
                ItemSwapped(this, new InventoryEventArgs(item));
                ItemAdded(this, new InventoryEventArgs(item));
            }
        }
    }