Assuming that what you mean is to shuffle the game objects as with a deck of cards, you need a shuffle algorithm, and assigning the positions:
public void ShuffleObjects(GameObjects[] toShuffle) {
// store the original position of each element
Vector3[] positions = new Vector3[toShuffle.Length];
for (int i = 0; i < toShuffle.Length; ++i) { positions _= toShuffle*.transform.position; }*_
Shuffle(toShuffle);
// assign the original positions to the shuffled array
for (int i = 0; i < toShuffle.Length; ++i) { toShuffle_.transform.position = positions*; }
}
public static void Shuffle(GameObject[] array) {
int count = array.Length;
int last = count - 1;
for (int i = 0; i < last; ++i) {
// select a random index to move to*
int randomIndex = UnityEngine.Random.Range(i, count);
// swap the elements
GameObject temp = array*;*
array = array[randomIndex];
array[randomIndex] = temp;
}
}
See [this][1] post for a more generic shuffling solution.
*[1]: https://answers.unity.com/questions/486626/how-can-i-shuffle-alist.html*_