How would you move from a array like from [2] to [3] or backwards like [2] to [1]

So lets say I am on example[3] I want to iterate to example[2] and only when a certain condition is met it will count down to array [2] but if I met a different condition it will count up to example[4] this is what I want to do so I can have 360 degrees coverage by my main camera on my player . help? I will post if I manage to solve my self

using UnityEngine;
using System.Collections;

public class CameraController : MonoBehaviour
{

    public GameObject player;

    private Vector3 offset;

    Vector3[] bawb = new Vector3[4]; 

    void Start()
    {
        offset = transform.position - player.transform.position;
        bawb[1] = new Vector3(10, 10, 10);
        bawb[2] = new Vector3(20, 20, 20);
        bawb[3] = new Vector3(30, 30, 30);
        bawb[4] = new Vector3(40, 40, 40);
//camera positions(^  are test vectors)
        
    }

    void Update()
    {
        if (Input.GetKeyDown("q"))
        {
            //condition to interate a array number up
        }
        else
        {
         if (Input.GetKeyDown("e"))
            {
//condition to interate a number down
            }
        }
    }

    void LateUpdate()
    {
        transform.position = player.transform.position + offset;
   //subtracting vectors to get preferd camera angle(no touchy >:( )
}
}

for (int i = 10 ; i > 5 ; i–) // will go from 10 to 6 by 1
{
Debug.Log(theArray*);*
}

for (int i = 10 ; i < 90 ; i+=10) // will go from 10 to 90 by 10
{
Debug.Log(theArray*);*
}

The form of the question is pretty hard to understand, but with a few guesses…

The index into an array is an integer. To ‘iterate up’ increment the integer. To ‘iterate down’ decrement it.

// make this an instance variable for the class
private int indx = 3; // index for array[3]
// these can go inside any method of the class
indx++; // increment
indx--; // decrement

If you go outside the range of the array, you will get a bounds error. So don’t. You need to add code to check for that.