Raising and Lowering Multiple Blocks based on a switch activation.

I am looking to have a Legend of Zelda Links Awakening Style Switch system. The goal is to raise lowered blocks and lower raised blocks. I currently have a script that works for raising and lowering a block. The biggest problem that I am having is that I can only get one block to work. My goal is to have the script on a prefab block so I can drop them wherever I need to. I have tried making a game object array using findgameobjectwithtag() to make an array of any objects with the script attached. Can anyone help me call all instances of the script. I’d rather not have to make a new script/gameobject for every set of blocks to raise and lower.

        if (coll.gameObject.tag == "Switch")
        {
            foreach (GameObject block in switchfloor)
            {
                block.GetComponent<Switches>().Switch();
            }
        }

Figured out a Solution. The commented Code was on each block. The uncommented code is on a parent game object of all blocks.

public class Switches : MonoBehaviour {

    public static Animator anim;
    public static bool uppered;
    public static BoxCollider2D hitme;
    public static GameObject[] blocks;
    public static Animator[] blockanims;
    public static BoxCollider2D[] blockcollids;


	// Use this for initialization
	void Start () {
        if (blocks == null)
        {
            blocks = GameObject.FindGameObjectsWithTag("Switch Blocks");
            blockanims = new Animator[blocks.Length];
            blockcollids = new BoxCollider2D[blocks.Length];
            for (int i = 0; i < blocks.Length; i++)
            {
                blockanims _= blocks*.GetComponent<Animator>();*_

blockcollids = blocks*.GetComponent();*
blockanims_.SetBool(“Up?”, blockcollids*.enabled);
}
}
/

anim = gameObject.GetComponent();
uppered = gameObject.GetComponent().enabled;
if(uppered)
{
anim.SetBool(“Up?”, uppered);
}
hitme = gameObject.GetComponent();*/
* }*_

public static void Switch()
{
for (int i = 0; i < blocks.Length; i++)
{
if (blockanims*.GetBool(“Up?”))*
{
blockanims*.SetBool(“Up?”, false);*
blockcollids*.enabled = false;*
}
else
{
blockanims*.SetBool(“Up?”, true);*
blockcollids*.enabled = true;*
}
}
}
/*
if(uppered)
{
anim.SetBool(“Up?”, false);
hitme.enabled = false;
uppered = false;
}
else
{
anim.SetBool(“Up?”, true);
hitme.enabled = true;
uppered = true;
}*/
}