unity2d 2d make same gameObject not spawn/instantiate more than once

basically what I am trying to do is make sure the same game-object does not spawn more than once before another game-object is spawned this is what I have got down so far thanks for any help in advance

Platformer2DUserControl abcd;
GameObject blocka;

public GameObject[] blocks;

void Start(){
	abcd = GameObject.Find ("character1").GetComponent<Platformer2DUserControl>();
}

// Update is called once per frame
void Update () {

	if (this.gameObject.transform.position.x > (abcd.latestblock.gameObject.transform.position.x + abcd.latestblock.transform.localScale.x - 0.4)) {

		abcd.latestblock = (GameObject)Instantiate (blocks [Random.Range (0, blocks.GetLength (0))], new Vector3(this.transform.position.x, this.gameObject.transform.position.y, 0), Quaternion.identity);

	}

}

Well. Let me check if I understand you right. You have a list of gameobjects. And a spawner that spawns a random gameobject out of this list but you don’t want it to spawn a GameObject A if it already has spawned a GameObject A before, right?
You could make prefabs for all the gameobjects you want to spawn, if you havent already. Than you simply could create two string variables to hold the objects name. The first one will hold the previous spawned objects name and the second will hold the name of the to be spawned object. Now check if the two variables have the same value, if so…return to start or sth…if not give the string for previous object the value of the new object and let the object spawn.

if anyone is looking for the final code that fixed it here it is:

Platformer2DUserControl abcd;
GameObject blocka;

public string blockname;
public int blockid;

public string previousblock;

public GameObject[] blocks;

void Start(){
	abcd = GameObject.Find ("character1").GetComponent<Platformer2DUserControl>();
}

// Update is called once per frame
void Update () {

	if (this.gameObject.transform.position.x > (abcd.latestblock.gameObject.transform.position.x + abcd.latestblock.transform.localScale.x - 0.4)) {

		
		while(abcd.latestblock.name == (blocks [blockid = Random.Range (0, blocks.GetLength (0))].name)){
		}

		abcd.latestblock = (GameObject)Instantiate (blocks [blockid], new Vector3(this.transform.position.x, this.gameObject.transform.position.y, 0), Quaternion.identity);

		blockname = blocks[blockid].name;

		abcd.latestblock.name = blockname;

	}

}