はじめに 「UnityRandom」を Unity プロジェクトに導入することで 豊富な乱数アルゴリズムを使用できるようになります 使用例 using System.Collections.Generic; using UnityEngine; public class Example : MonoBehaviour { private void Awake() { // 初期化 var urand = new UnityRandom(); // 初期化(シード値指定) //var urand = new UnityRandom( 123456 ); // 0 - 1 print( urand.Value() ); // 1 - 100 print( urand.Range( 1, 100 ) ); // ポアソン分布 print( urand.Possion( 5 ) ); // 指数分
![【Unity】豊富な乱数アルゴリズムを使用できる「UnityRandom」紹介 - コガネブログ](https://cdn-ak-scissors.b.st-hatena.com/image/square/47522ef667e6d585802326ad888464f8908b20f6/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fb%2Fbaba_s%2F20180826%2F20180826191726.png)