Show an image array in a loop

Think in a slot machine.

In one column, I got an array of X images (“Slide”, in the image below, has 3 elements as example). I got a window (a GUILayout). I want that the images of the array are shown in that window, then the image moves down, and the next image of the array moves in the window. I got that. The thing is that when I reach the end of the array, there’re no more images to show. I need to put back the 1st element of the array on the top of the last image. How can I do that??

I leave an image for better explanation.

Code:
Here the array has 13 elements. Only can be shown 3 elements at time (it’s a 3x5 slot machine, the image was illustrative, to get the idea).

function drawCol(col : int, movement :float)
{
	var x : int = 0 + (col * images[0].width);
	var y : float = 0;
	var image : Texture2D;
			
	GUILayout.BeginArea(Rect(slotX, slotY, images[0].width * 5, images[0].height * 3));
	
	for(var i : int = 0; i < 13; i++) 
	{			
		if(oneTime == false) 
		{ 
			// Fills the array with random symbols
			
			var randomImage : int = Random.Range(0,images.length);
			image = images[randomImage]; 
			slotGrid[col,i] = randomImage;
		}
		else 	
		{					
			image = images[slotGrid[col,i]];  //Gets the already stored symbols
		}	
		
		// Sets y based on the height of the image (uses 0 index because all images must have the same size)
		// rests images[0].height * 10 because if not, the slot grid is drawn from 0 to 1536. We need that is
		// drawn from -1536 to 384 (slot grid area, where the Layout is)
		
		y = images[0].height * i + movement - (images[0].height * 10);
						
		if((y < images[0].height * 3) && (y  >= slotY - images[0].height )) // Only draws a texture if it's in visible area 
		{
			GUI.DrawTexture(Rect(x, y, image.width, image.height), image);
		}
	}	
	
	GUILayout.EndArea();
}

If I’m reading this correctly it sounds like you need a temp array, I would suggest using this temp array as the display array, once you reach the end of the listArray start filling the temp array with listArray 1; I’ll work on a script real quick and see if it helps you.

EDIT: Hope code works for you.

using UnityEngine;
using System.Collections;

public class arrayDisplay : MonoBehaviour {
	
	public int[] displayHolder;
	public int[] tempArray;
	public int counter;

	// Use this for initialization
	void Start () {
		
		for (int i = 0; i < 3; i++)
		{
			tempArray _= displayHolder*;  //Initialize tempArray	*_

* }*
* StartCoroutine(arrayDisplayer());*

* }*

* IEnumerator arrayDisplayer ()*
* {*
* Debug.Log (“tempArray” + tempArray[0]);*
* Debug.Log (“tempArray” + tempArray[1]);*
* Debug.Log (“tempArray” + tempArray[2]);*
* yield return new WaitForSeconds (1);*

* if (counter >= 9)*
* counter = 0;*
* else*
* counter++;*
* tempArray[0] = displayHolder[counter]; //Initialize tempArray *
* if (counter >= 9)*
* counter = 0;*
* else*
* counter++;*
* tempArray[1] = displayHolder[counter]; //Initialize tempArray *
* if (counter >= 9)*
* counter = 0;*
* else*
* counter++;*
* tempArray[2] = displayHolder[counter]; //Initialize tempArray *

* StartCoroutine(arrayDisplayer());*
* }*
}