private void OnTriggerEnter(Collider other) { var findingPickUpItem = other.GetComponent <IPickUpItem>(); if (findingPickUpItem != null) { PickUpEvent?.Invoke(findingPickUpItem); } }
private void OnTriggerEnter(Collider other) { if (other.tag.Equals("PickUp") && canPickUp) { PickUp pickUpItem = other.GetComponent <PickUp>(); ItemGroup extraItemGroup = null; backpack.TryPutIn(pickUpItem.itemGroup, out extraItemGroup); PickUpEvent?.Invoke(this, new PickUpEventDate(pickUpItem, attrManager.faction)); } }