[英]Unity (C#) random numbers are created in batches
I'm creating 500 random numbers in a Unity project like so:我在 Unity 项目中创建 500 个随机数,如下所示:
int[] random_numbers = new int[500];
for(int i = 0; i < 500; i++)
{
random_numbers[i] = UnityEngine.Random.Range(60, 100);
}
The results I get are the numbers seem to be created in batches.我得到的结果是数字似乎是分批创建的。 For example, I will get the number 89 ten times in a row and then the number 95 ten times in a row and so on.
例如,我会连续十次得到数字 89,然后连续十次得到数字 95,依此类推。 I don't have a problem with getting the same number, but I can't have them created in large batches like this.
获得相同的数字没有问题,但我不能像这样大批量创建它们。
I understand that the Unity random number engine uses the clock to create the number.我了解 Unity 随机数引擎使用时钟来创建数字。 I'm wondering how I can get better quality random numbers?
我想知道如何获得质量更好的随机数?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.