public static ItemUI CreateItemUIElement(string itemName, Sprite itemImage, int itemQuantity, Transform parent) { GameObject newItem = Instantiate(GameManager.instance.itemUIPrefab, parent); ItemUI itemUI = newItem.GetComponent <ItemUI>(); itemUI.ChangeItemImage(itemImage); itemUI.ChangeItemName(itemName); itemUI.ChangeItemQuantity(itemQuantity.ToString()); return(itemUI); }