How to update a bool in all existing objects in an array

Looked all over the place for this but basically making a clone of a game I used to play as a kid called “Orcs must die”. I manage to get a spawner and target system working, as well as melee animations and the whole shebang, but that was until I started working on gate health. Now I needed to make every existing orc and soon to exist orc to check to see if the gate is up or down. If up attack gate if down hunt player. I’ve tried arrays, I’ve tried redirecting using true and false statements. I’m just stuck. Here is the code I have in my gate function.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;


public class gateBehavior : MonoBehaviour
{
    //Wall Stats
    public float maxHealth = 20f;
    public float Health = 20f;
    public string thisName= "";
    public TilemapRenderer tba;
    public TilemapRenderer tbb;
    public OrcBehavor ocb;
    public GameObject[] Orcs;





    void Start()
    {
        //Sets Stats
        Health = maxHealth;
        

    }

    void Update()
    {

        

        if (Health <= 0) //When Wall is broken
        {
            print("Gate Destoryed");//Checkpoint for me to know the code made it this far
            if (thisName == "GateA")//There are 2 exsisting gamtes. This is for gateA
            {
                tba.enabled = false;
                Orcs = GameObject.FindGameObjectsWithTag("Orcc"); //Checks for all exsisting Orcs with the tag "Orccs. This includes the clones"
                foreach (GameObject orc in Orcs)
                {
                    ocb = GetComponent<OrcBehavor>();
                    ocb.gateAUp = false;
                }
            }
            if (thisName == "GateB")//And this for Gate B (More to exsist in the later game)
            {
                tbb.enabled = false; //WIP Gotta finish gate A first
                ocb.gateBUp = false; //WIP
            }
        }
    }

    public void TakeDamage(float damage) //When Hit
    {
        Health -= damage;
        print("Bonk"); //When Hit say Bonk, A Checkpoint for me to know the code made it this far

    }
}

That is exactly what loop are for, you a for loop or foreach loop

foreach (GameObject orc in Orcs)
{
                     ocb = GetComponent<OrcBehavor>();
                     ocb.gateAUp = gateUp//not sure what you variable is..
}

actually it would be better to make a static variable then you only need to update one value.