public void addItems(string name) { listItems.Add(name); GameObject newItem = Instantiate(prefabItems); newItem.transform.SetParent(listSlots[amountItems].transform, false); newItem.GetComponent <Image> ().sprite = Resources.Load <Sprite> ("Sprites/" + name); amountItems++; if (amountItems == 3) { painelVestimenta.GetComponent <Animator> ().SetFloat("speed", -1); menuAnim.animButtonNext(1); } }