private void AddButtons() { for (int i = 0; i < projects.data.Length; i++) { ProjectData file = projects.data[i]; GameObject newButton = fileDirectory.Get_Object(); newButton.transform.SetParent(contentPanel); ProjectButton fileButton = newButton.GetComponent <ProjectButton>(); //if (fileButton.FileText == null){ // fileButton.FileText = fileButton.GetComponent<Text>(); // fileButton.FileImage = fileButton.GetComponent<Image>(); //} fileButton.Setup(file, this); } }