Right now in my Unity project I have a list of buttons that are spawned in a scroll list when I start my game. Each of these buttons are linked to a prefab button. I am trying to make it so that when I click any of these buttons, an image pops up. I have this code attached to my prefab button, and I tested it using a debug log, and that works fine, but the image will not actually pop up. I am not sure what the issue is. It is all dealing with my UI. Here is my code:
public Image popUpImage;
void Start ()
{
popUpImage.enabled = false;
button.onClick.AddListener (activatePopUp);
}
public void activatePopUp()
{
popUpImage.enabled = true;
Debug.Log("pop up is active");
}
Why won't my image actually pop up if the debug is working? I attached my image to the inspector as well.