GUITexture multiple component activation

Hi guys,

I basically have a certain number of GUITextures in my scene and i want to be able to scroll through each one seperately. Generally what will happen is; the player will start off with GUITexture1 and when they press either a left or right button, they should go to a previous or next GUITexture.

So TLDR; i want to scroll through multiple GUITextures by enable/disable but at the moment it goes through to my second GUITexture(notes2) and then quickly onto 3. How do i get it to stay on 2?

Here is what i have tried so far:

    if (rightButton.tapCount>0&&noteSwitch == NoteSwitch.Notes1)
    {
        noteSwitch = NoteSwitch.Notes2;
    }
    else if (rightButton.tapCount>0&&noteSwitch == NoteSwitch.Notes2)
    {
        noteSwitch = NoteSwitch.Notes3;
    }
    if (leftButton.tapCount >0&&noteSwitch == NoteSwitch.Notes3)
    {
        noteSwitch = NoteSwitch.Notes2;
    }
    else if (leftButton.tapCount >0&&noteSwitch == NoteSwitch.Notes2)
    {
        noteSwitch = NoteSwitch.Notes1;
    }

You need to put some ‘else’ clauses in your code.

if (rightButton.tapCount>0&&noteSwitch == NoteSwitch.Notes1)
{
    noteSwitch = NoteSwitch.Notes2;
}
else if (rightButton.tapCount > 0 && noteSwitch == NoteSwitch.Notes2)
{
    noteSwitch = NoteSwitch.Notes3;
}
if (leftButton.tapCount > 0 && noteSwitch == NoteSwitch.Notes3)
{
    noteSwitch = NoteSwitch.Notes2;
}
else if (leftButton.tapCount > 0 && noteSwitch == NoteSwitch.Notes2)
{
    noteSwitch = NoteSwitch.Notes1;
}

Note this kind of behavior is easier handled by using an array rather that state and somewhat complex ‘if’ statements.