public void PickUp(Item item) { _items.Add(item); OnItemPickedUp?.Invoke(item); item.transform.SetParent(_itemsContainer); Equip(item); }
public static void ItemPickedUp(Item item) { if (OnItemPickedUp != null) { OnItemPickedUp.Invoke(item); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { OnItemPickedUp?.Invoke(this.gameObject); } }
public void PickUpClosestItem() { if (detector.ClosestPickUp == null) { return; } pickedUpItem = detector.ClosestPickUp; if (pickedUpItem.PickUpItem(playerGrabTransform)) { OnItemPickedUp?.Invoke(pickedUpItem); } }
public virtual void TakeItem() { if (Inventory.Instance.CheckIfSpace(m_ObjectData)) { base.PlayerActionEvent(); Inventory.Instance.AddItem(m_ObjectData, 1); OnItemPickedUp?.Invoke(m_ObjectData); Destroy(this.gameObject); } else { Inventory.Instance.SlotsAreAllTaken(); Debug.Log("Cant pick up backpack is full"); } }
public bool TryReceiveItem(PickUp item) { if (pickedUpItem != null) { return(false); } if (item.PickUpItem(playerGrabTransform)) { pickedUpItem = item; OnItemPickedUp?.Invoke(pickedUpItem); return(true); } return(false); }
public static void ItemPickedUp(string nameOfObject) { OnItemPickedUp?.Invoke(nameOfObject); }
public static void FireItemPickedUp(TrinityItem item) { Core.Logger.Log(LogCategory.ItemEvents, $"ItemPickedUp {item.Name}"); OnItemPickedUp?.Invoke(item); }