Hızlı yanıt: kod örneği
stackoverflow.com random-numbers-in-unity3d
In Unity C# the method is as followsSee Unity Documentation - RandomThe method will accept either integer or float arguments. If using ints is inclusive and is exclusive of the returned random value. In your case it would be:Instead of .If using floats, for exampleThe return value is also a float, and are inclusive in this case.
Random.Range(minVal, maxVal);
minVal
maxVal
Random.Range(1,4);
Next(1,4)
Random.Range(1.0F, 3.5F);
minVal
maxVal