public static T GetRandom <T>(this T[] arr, RNG rng) { return(arr[Mathf.Clamp((int)(rng.Next() * arr.Length), 0, arr.Length)]); }
public static T GetRandom <T>(this List <T> list, RNG rng) { return(list[Mathf.Clamp((int)(rng.Next() * list.Count), 0, list.Count)]); }