Out of curiosity, why do we need 2 SetItem() functions in InventoryItemIcon.cs outside of it being for convenience sake (my assumption)?
public void SetItem(InventoryItem item)
{
SetItem(item, 0);
}
public void SetItem(InventoryItem item, int quantity)
{
var iconImage = GetComponent<Image>();
if (item == null)
{
iconImage.enabled = false;
}
else
{
iconImage.enabled = true;
iconImage.sprite = item.GetIcon();
}
if (itemQuantity)
{
if (quantity <= 1)
{
textContainer.SetActive(false);
}
else
{
textContainer.SetActive(true);
itemQuantity.text = quantity.ToString();
}
}
}