diff --git a/Source/Engine/Engine/RandomStream.cs b/Source/Engine/Engine/RandomStream.cs index 342faeb9c..90be3bd2c 100644 --- a/Source/Engine/Engine/RandomStream.cs +++ b/Source/Engine/Engine/RandomStream.cs @@ -1,6 +1,5 @@ // Copyright (c) 2012-2022 Wojciech Figat. All rights reserved. -using System; using System.Runtime.CompilerServices; #pragma warning disable 675 @@ -16,12 +15,12 @@ namespace FlaxEngine /// /// Holds the initial seed. /// - private int _initialSeed = 0; - + private int _initialSeed; + /// /// Holds the current seed. /// - private int _seed = 0; + private int _seed; /// /// Init @@ -91,8 +90,8 @@ namespace FlaxEngine public unsafe bool GetBool() { MutateSeed(); - fixed (int* seedPtr= &_seed) - return *seedPtr < (uint.MaxValue/ 2); + fixed (int* seedPtr = &_seed) + return *seedPtr < (uint.MaxValue / 2); } /// @@ -102,7 +101,7 @@ namespace FlaxEngine { MutateSeed(); fixed (int* seedPtr = &_seed) - return (uint)*seedPtr; + return (uint)*seedPtr; } /// @@ -159,7 +158,7 @@ namespace FlaxEngine [MethodImpl(MethodImplOptions.AggressiveInlining)] public int RandHelper(int a) { - return a > 0 ? Mathf.FloorToInt(GetFraction() *((float)a - Mathf.Epsilon)) : 0; + return a > 0 ? Mathf.FloorToInt(GetFraction() * ((float)a - Mathf.Epsilon)) : 0; } /// @@ -186,7 +185,7 @@ namespace FlaxEngine { return min + (max - min) * Rand(); } - + /// /// Mutates the current seed into the next seed. /// diff --git a/Source/Engine/Engine/RandomUtil.cs b/Source/Engine/Engine/RandomUtil.cs index aaeed860d..41682dc53 100644 --- a/Source/Engine/Engine/RandomUtil.cs +++ b/Source/Engine/Engine/RandomUtil.cs @@ -8,8 +8,7 @@ namespace FlaxEngine /// /// Basic pseudo numbers generator utility. /// - [HideInEditor] - public class RandomUtil + public static class RandomUtil { private static readonly Random _random = new Random();