public Vector2 GetRandomPoint() { float magnitude = PRandom.Range(InnerRadius, OuterRadius); var direction = Vector2.right.Rotate(PRandom.Range(0f, 360f)); return(direction * magnitude + Position); }
public static T GetRandom <T>(this IList <T> array) { if (array == null || array.Count == 0) { return(default(T)); } return(array[PRandom.Range(0, array.Count - 1)]); }
public float GetRandom(ProbabilityDistributions distribution = ProbabilityDistributions.Uniform) { return(PRandom.Range(min, max, distribution)); }
public static T PopRandom <T>(this T[] array, out T[] remaining) { return(array.Pop(PRandom.Range(0, array.Length - 1), out remaining)); }