示例#1
0
 public float Get(System.Random random)
 {
     if (Math.Abs(Max) < 0.00001f && Math.Abs(Min) < 0.00001f)
     {
         return(0);
     }
     if (Max < Min)
     {
         return(random.NextFloat(Max, Min));
     }
     return(random.NextFloat(Min, Max));
 }
示例#2
0
        public Vector3 Get(System.Random random)
        {
            if (Math.Abs(Max) < 0.001f && Math.Abs(Min) < 0.001f)
            {
                return(Vector3.zero);
            }
            var value = random.NextFloat(Min, Max);

            if (!AllowZero)
            {
                while (Math.Abs(value) < 0.1f)
                {
                    value = random.NextFloat(Min, Max);
                }
            }
            return(new Vector3(value, value, value));
        }
示例#3
0
 protected float GetRandomHeight(System.Random random)
 {
     return(random.NextFloat(HeightScale.x, HeightScale.y));
 }
示例#4
0
 protected float GetRandomWidthScale(System.Random random)
 {
     return(random.NextFloat(WidthScale.x, WidthScale.y));
 }