private void AddButtons() { for (int i = 0; i < itemList.Count; i++) { Item item = itemList[i]; GameObject newButton = objectPool.GetObject(); newButton.transform.SetParent(this.contentPanel); ButtonScript button = newButton.GetComponent <ButtonScript>(); button.Setup(item, this, this.popupSpawn); } }