Create HeroDeck with state of cards

This commit is contained in:
henriquenakashima 2020-09-19 13:52:16 -04:00
parent 967c871ed9
commit 567b732f85
7 changed files with 175 additions and 17 deletions

18
Assets/ListShuffle.cs Normal file
View file

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class ListShuffle
{
public static void Shuffle<T>(this IList<T> list)
{
int n = list.Count;
while (n > 1) {
int k = Random.Range(0, n);
n--;
T value = list[k];
list[k] = list[n];
list[n] = value;
}
}
}