public void CreateListItemGift(string id, string fName) { ListItemGift tempItem = Instantiate(itemGiftPref) as ListItemGift; tempItem.fId = id; tempItem.txtName.text = fName; tempItem.transform.SetParent(listGiftContainer.transform, false); listGifts.Add(tempItem); }
public void CreateListItemGift(string id, string fName) { int timeLeft = 0; ListItemGift tempItem = Instantiate(itemGiftPref) as ListItemGift; tempItem.fId = id; tempItem.txtName.text = fName; if (!CheckIfGiftCanBeSend(fName, ref timeLeft)) { Debug.Log(timeLeft); tempItem.SetButton(false); tempItem.giftImage.enabled = false; tempItem.buttonText.text = timeLeft.ToString() + "h"; tempItem.buttonText.enabled = true; } else { tempItem.SetButton(true); } tempItem.transform.SetParent(listGiftContainer.transform, false); listGifts.Add(tempItem); }