示例#1
0
 public static T GetRandomElementFromList <T>(this List <T> list, RNG rng)
 {
     return(rng.RandomElement <T>(list));
 }
示例#2
0
 public static Vector2Int GetRandomValueInt(this Rect r, RNG rng)
 {
     return(new Vector2Int(r.GetXRange().RandomValuei(rng), r.GetYRange().RandomValuei(rng)));
 }
示例#3
0
 public static Vector2 GetRandomValue(this Rect r, RNG rng)
 {
     return(new Vector2(r.GetXRange().RandomValuef(rng), r.GetYRange().RandomValuef(rng)));
 }
示例#4
0
文件: Range.cs 项目: Kerr1291/common
 public float RandomNormalizedValue(RNG rng)
 {
     return(NormalizedValue(rng.Rand(Min, Max)));
 }
示例#5
0
文件: Range.cs 项目: Kerr1291/common
 public float RandomValuef(RNG rng)
 {
     return(rng.Rand(Min, Max));
 }
示例#6
0
文件: Range.cs 项目: Kerr1291/common
 public int RandomValuei(RNG rng)
 {
     return(rng.Rand((int)Min, (int)Max));
 }