public void addItem(IInventoryItem item)
    {
        items.Add(item);
        item.onPickup();

        //broadcast event to the hud
        if (ItemAdded != null)
        {
            ItemAdded.Invoke(this, new InventoryEventArgs(item));
        }
    }
Ejemplo n.º 2
0
    public void addItem(IInventoryItem item)
    {
        // Add item to inventory
        items.Add(item);

        item.onPickup();

        if (ItemAdded != null)
        {
            Debug.Log("Inventory addItem");
            ItemAdded.Invoke(this, new InventoryEventArgs(item));
        }
    }
Ejemplo n.º 3
0
    public void addItem(IInventoryItem item)
    {
        //checking if the item is already in the list prevents the double pick-ups that were occurring
        Debug.Log("Inventory addItem");
        if (!items.Contains(item))
        {
            items.Add(item);
            item.onPickup();

            //broadcast event to the hud
            if (ItemAdded != null)
            {
                ItemAdded.Invoke(this, new InventoryEventArgs(item));
            }
        }
    }