Can't create a slide-show

I want to make a slide-show in my game. I have 17 images an I want to show them one after another using coroutines and SetActive.

But my code doesn’t work. Can’t understand, what’s wrong.

    public Texture2D[] developmentPreview;

	public IEnumerator StartDevelopmentPreview()
	{
		foreach(Texture2D i in developmentPreview)
		{
			i.SetActive(true);
			yield return new WaitForSeconds(0.2);
			i.SetActive(false);
		}
	}

You can not call a coroutine directly from a Button component’s event.

You can create a function that will be called on button click and this function will start the coroutine. Something like:

public Texture2D[] developmentPreview;

// Call this StartSlideShow method from the button's event
public void StartSlideShow() {
    StartCoroutine("StartDevelopmentPreview");
}

 IEnumerator StartDevelopmentPreview()
 {
     foreach(Texture2D i in developmentPreview)
     {
         i.SetActive(true);
         yield return new WaitForSeconds(0.2f);
         i.SetActive(false);
     }
 }

I haven’t tested it but i would just set the renderer for each object:

 i.renderer.enabled = true;
 i.renderer.enabled = False;