Extension method for System.Random that returns a float in a given range. It multiplies random.Float() by the range width and adds the minimum to produce a value between minValue and maxValue.
using System;
namespace SWB.Shared;
public static class RandomExtensions
{
public static float NextFloat(
this Random random,
float minValue,
float maxValue )
{
return random.Float() * (maxValue - minValue) + minValue;
}
}