What's the different between this
int randomNumber = UnityEngine.Random.Range(0, 10);
and this
// on top of the class
private System.Random _rnd = new System.Random();
// inside a methode of the same class
int randomNumber = _rnd.Next(0, 10);
I know System.Random
must always be initialized on the top of your class what's by UnityEngine.Random
is not needed. I know also that System.Random
works with a intern clock"clock" and the "random" number is based on that.
My question is now are there some other difference between UnityEngine.Random
and System.Random
and witch code is better to use for aan Unity project?