private void AddItemImage(ItemInfo itemAdded) { GameObject itemObject = GameObject.Instantiate(ItemImagePrefab, ItemsGroup.transform); ItemImage itemImage = itemObject.GetComponent <ItemImage>(); itemImage.SetItem(itemAdded); itemImage.SetSprite(itemAdded.Sprite); itemImage.SetQuantityText(itemAdded.Quantity); ItemImages.Add(itemImage); }
private void UpdateItemImage(ItemInfo itemUpdated) { ItemImage itemImage = GetItemImage(itemUpdated); itemImage.SetQuantityText(itemUpdated.Quantity); }