// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
using System.Runtime.CompilerServices;
namespace FlaxEngine
{
///
/// Basic pseudo numbers generator utility.
///
public static class RandomUtil
{
///
/// Random numbers generator.
///
public static readonly Random Random = new Random();
///
/// Generates a pseudo-random number from normalized range [0;1].
///
/// The random number.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Rand()
{
return Random.Next(0, int.MaxValue) / (float)int.MaxValue;
}
}
}