public new void RemoveAt(int index) { var e = base[index]; base.RemoveAt(index); ItemRemove?.Invoke(e, index); }
public virtual bool Remove(TItem item) { var result = _Items.Remove(item); if (result) { //var handlers = ItemRemove; //if (handlers != null) // handlers(item); ItemRemove?.Invoke(item); } return(result); }
//Removes the item from the inventory list then drops the item. Turns on colliders to make it the same as it was before. Activating the object in the view public void RemoveItem(TheInventoryItem item) { //Debug.Log("This is the remove item"); if (myItems.Contains(item)) { myItems.Remove(item); item.OnDrop(); //Debug.Log("This is the ondrop"); Collider collider = (item as MonoBehaviour).GetComponent <Collider>(); if (collider != null) { collider.enabled = true; } ItemRemove?.Invoke(this, new InventoryEventArgs(item)); } }