public void AddItem(IInventoryItem item) { if (mItems.Count < SLOTS) { Collider collider = (item as MonoBehaviour).GetComponent <Collider>(); if (collider.enabled) { collider.enabled = false; mItems.Add(item); item.Onpickup(); if (ItemAdded != null) { ItemAdded(this, new InventoryEventArgs(item)); } } } }