void AddItemToInventory(Item_old i) { GameObject tempObj = Instantiate(itemPrefab, gridLayout.transform) as GameObject; tempObj.GetComponent <Image> ().sprite = i.image; //tempObj.GetComponentInChildren<Text> ().text = i.name; }
public static void AddItem(Item_old i) { items.Add(i); //Update UI }