protected private void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Item") { if (other.bounds.size.x * other.bounds.size.y <= maxSize) { GameObject otherObject = other.gameObject; otherObject.SetActive(false); inventory.Add(otherObject); } } }
public void AddToItemInventory(Item item) { ItemInventory.Add(item); }