Extension method for System.Random that returns a float in a specified range. It multiplies random.Float() by the range and adds the min value.
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;
}
}