Losowe wymieszanie tablicy C# Unity

void Start()
{
    int[] numArray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
    Shuffle(numArray);
    for (int i = 0; i < numArray.Length; i++)
    {
        Debug.Log(numArray[i]);
    }
}


void Shuffle<T>(T[] a)
{
    for (int i = a.Length - 1; i > 0; i--)
    {
        int rnd = Random.Range(0, i);
        T temp = a[i];
        a[i] = a[rnd];
        a[rnd] = temp;
    }
}
Scroll to Top