Disabling BoxCollider2D on multiple gameobjects

Hey all, what im trying to do is pretty simple, (in context)

In short i have a pressure plate with the following code.

public class _PressurePlate : MonoBehaviour {

	public bool pressurePlateActive = false;
	public GameObject tgtToChange;
	public bool isThisLatching;
	void OnTriggerEnter2D(Collider2D other){
		if(pressurePlateActive == false){
			if(other.transform.tag == "Player"){
					Debug.Log("I am on now.");
					
					tgtToChange.GetComponent<BoxCollider2D> ().enabled = false;
					tgtToChange.GetComponent<SpriteRenderer> ().sprite = Resources.Load<Sprite> ("_Sprites/_Overworld/_TestBarrierDown");
				if(isThisLatching == true){
					pressurePlateActive = true;
					Debug.Log ("I am now locked.");

				}
   		}
		}
	}

	void OnTriggerExit2D(Collider2D other){
		if(other.transform.tag == "Player"){
			if (isThisLatching == true) {
			} 
			else {
				Debug.Log("I am off now.");
				tgtToChange.GetComponent<BoxCollider2D> ().enabled = true;
				tgtToChange.GetComponent<SpriteRenderer> ().sprite = Resources.Load<Sprite> ("_Sprites/_Overworld/_TestBarrierUp");
			}
   	}
	}
}

What i am trying to do is expand on tgtToChange to allow me to add multiple gameobjects, any help would be great!

What you want, then is an array. You can declare it like so:

public GameObject[] targetsToChange;

Then you can assign those in the editor.
Then you can change your disable code to be in a loop that looks something like:

foreach(GameObject go in targetsToChange) {
    go.GetComponent<BoxCollider2D>().enabled = false;
}

Code may have typos, but it’s the general idea of what you’re trying to accomplish.

Reference for arrays: here