// add itemScript public void AddItem(ItemScript itemScript) { // adding the itemScript to the slot items.Push(itemScript); // checking if there is more the one itemScript if (items.Count > 1) { // adding the number of itemScript to the text stackText.text = items.Count.ToString(); } // change the sprite ChangeSprite(itemScript.GetSpriteNeutral(), itemScript.GetSpriteHighlighted()); }