27.09.2020
~ Moved Default-Shader to 2D to provied 2D-specific feature ~ Fixed UVs in Polygon
This commit is contained in:
parent
617a7ef044
commit
2aa12f8d25
19 changed files with 166 additions and 83 deletions
22
SMCode/SM.Base/Utility/Randomize.cs
Normal file
22
SMCode/SM.Base/Utility/Randomize.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
|
||||
namespace SM.Utility
|
||||
{
|
||||
public class Randomize
|
||||
{
|
||||
public static Random Randomizer = new Random();
|
||||
|
||||
public static void SetSeed(int seed) { Randomizer = new Random(seed); }
|
||||
|
||||
public static bool GetBool(float tolerance) { return Randomizer.NextDouble() > tolerance; }
|
||||
|
||||
public static int GetInt() { return Randomizer.Next(); }
|
||||
public static int GetInt(int max) { return Randomizer.Next(max); }
|
||||
public static int GetInt(int min, int max) { return Randomizer.Next(min, max); }
|
||||
|
||||
public static float GetFloat() { return (float)Randomizer.NextDouble(); }
|
||||
public static float GetFloat(float max) { return (float)Randomizer.NextDouble() * max; }
|
||||
public static float GetFloat(float min, float max) { return (float)Randomizer.NextDouble() * max + min; }
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue