public void DisplayItem() { if (playerInRange) { if (displayedItem.thisInventory.Count > 0) { Item newItem = displayedItem.thisInventory[0]; takeItem = invMan.AddItemInOpenSpace(newItem.thisItemsPrefab); displayedItem.RemoveItem(displayedItem.thisInventory[0]); myNotification.Raise(); } displayedItem.AddItem(invUIman.currItemShell?.item); playerInventory.RemoveItem(invUIman.currItemShell?.item); } if (displayedItem.thisInventory.Count > 0) { sprend.sprite = displayedItem.thisInventory[0]?.itemIcon; } }
public void GetItem() { InventoryManager invMan = FindObjectOfType <InventoryManager>(); bool pickedUpItem = invMan.AddItemInOpenSpace(this.gameObject); //add to the bag matrix. if (pickedUpItem) { Destroy(this.gameObject); } }