Check out example codes for "how to randomize ther order of elements in an array in unity". It will help you in understanding the concepts better.

Code Example 1

using UnityEngine; using System.Collections;  public class DeckShuffle : MonoBehaviour {     public GameObject[] decklist;     private GameObject tempGO;          void Start () {         Shuffle();     }          public void Shuffle() {         for (int i = 0; i < decklist.Length; i++) {             int rnd = Random.Range(0, decklist.Length);             tempGO = decklist[rnd];             decklist[rnd] = decklist[i];             decklist[i] = tempGO;         }     } }

Learn ReactJs, React Native from akashmittal.com