Display multiple GUITextures in Sequence w Trigger & Key Press

Hi - I posed this question a little while back and got a few helpful responses, although I haven’t fully solved the problem I’m having.

I have multiple trigger colliders set up in my scene. When the player enters a trigger area, I’d like them to be able to press a button (Spacebar) and display a GUI, press Spacebar again to display 2nd GUI, again to display 3rd GUI, etc. These GUIs should display is a specific sequence. Essentially, I’m trying to mimic looking at pages of a book, in order, but without any sort of “page turning” animation.

I have developed a Javascript that is, for the most part, working. However, during gmaeplay, sometimes (but not all of the time) it will display the pages out of sequence. It’s also built with a lot of “if, else if” statements, which I know some people arent a big fan of. In some cases, there are many more GUIs to display (up to 16) so this gets a bit clunky.

If anyone has thoughts on how to make this code cleaner and a bit more foolproof, I’d love to hear them. Thanks for your advice!

#pragma strict


var Texture1 : GUITexture;
var Texture2 : GUITexture;
var Texture3 : GUITexture;

function OnTriggerStay()
 {
 if(Texture1.enabled == false && Texture2.enabled == false && Texture3.enabled == false && Input.GetKeyDown( KeyCode.Space ))
  {
  Texture1.enabled = true;
  Texture2.enabled = false;
  Texture3.enabled = false;
  }
	
 else if(Texture1.enabled == true && Texture2.enabled == false && Texture3.enabled == false && Input.GetKeyDown( KeyCode.Space ))
  {
  Texture1.enabled = false;
  Texture2.enabled = true;
  Texture3.enabled = false;
  }
		
 else if(Texture1.enabled == false && Texture2.enabled == true && Texture3.enabled == false && Input.GetKeyDown( KeyCode.Space ))
  {
  Texture1.enabled = false;
  Texture2.enabled = false;
  Texture3.enabled = true;
  }

 else if(Texture1.enabled == false && Texture2.enabled == false && Texture3.enabled == true && Input.GetKeyDown( KeyCode.Space ))
  {
  Texture1.enabled = false;
  Texture2.enabled = false;
  Texture3.enabled = false;
  }
	
}
	
     
function OnTriggerExit()
 {
     
 Texture1.enabled = false;
 Texture2.enabled = false;
 Texture3.enabled = false;
     
 }

Time to start using some for loops.
Forgive me, I have not used Javascript in years, I use C# now but something like this.

public  var myTextureArray : GUITexture[];
public var textureIndex : int = 0;

function NextTexture(){
    // here is the for loop,we make a variable i which equals 0 and it will run throu the loop and add 1 to i every round as long as i is less than the amount of textures in the array.
    for(var i : int = 0; i< myTextureArray.Length;i++){
    if(i == textureIndex){
       myTextureArray*.enabled = true;*

}
else{
myTextureArray*.enabled = false;*
}
}
textureIndex++;
}
The way a for loop works is like this.
For( Variable to iterate ; under which condition ; what to do while the condition is true)
Or ( for 0; while 0 is less than array.length ; add 1 and run the following block)