In this example, i’ll show you Hot to generate a random number between two numbers.
C# Code:
1 2 3 4 5 6 7 |
static float NextFloat(float min, float max){ System.Random random = new System.Random(); double val = (random.NextDouble() * (max - min) + min); return (float)val; } |