using UnityEngine;

public class ImageSwitcher : MonoBehaviour
{

    public GameObject[] pictures;
    private int currentIndex = 0;
    void Start()
    {
 
        if (pictures.Length > 0)
        {
            for (int i = 0; i < pictures.Length; i++)
            {
                pictures[i].SetActive(false);
            }

            pictures[0].SetActive(true);
            currentIndex = 0;
        }
    }
    public void NextPicture()
    {
        if (pictures.Length == 0) return;

        pictures[currentIndex].SetActive(false);

        currentIndex++;

        if (currentIndex >= pictures.Length)
        {
            currentIndex = 0; 
        }
        pictures[currentIndex].SetActive(true);
    }
}