You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
770 B
24 lines
770 B
using Sog;
|
|
using UnityEngine;
|
|
using Random = UnityEngine.Random;
|
|
public static class RandomSrv
|
|
{
|
|
private static SRandom s_SRandom = new SRandom(123456789);
|
|
public static float value => Random.value;
|
|
public static Fixed64Vector2 insideUnitCircle => s_SRandom.GetRandomUnitCircle();
|
|
|
|
public static float Range(float minInclusive, float maxInclusive)
|
|
{
|
|
return Random.Range(minInclusive, maxInclusive);
|
|
}
|
|
|
|
public static Fixed64 Range(Fixed64 minInclusive, Fixed64 maxInclusive)
|
|
{
|
|
maxInclusive -= minInclusive;
|
|
return s_SRandom.NextFloat() * maxInclusive + minInclusive;
|
|
}
|
|
public static int Range(int minInclusive, int maxExclusive)
|
|
{
|
|
return Random.Range(minInclusive, maxExclusive);
|
|
}
|
|
}
|
|
|