1. 网上很多方法都说用时间种子来解决,但是在极短的时间内,这种方法没效 Random r = new Random(DateTime.Now.Millisecond); Random Counter = new Random(unchecked((int)(DateTime.Now.Ticks >> ctr))); Random Counter = new Random(System.Guid.NewGuid().GetHashCode()); 2. 用Random结合Hashtable才完
随机数几乎应用于游戏开发的方方面面,例如,随机生成的地图,迷宫,怪物属性等,在Unity中,使用随机数非常方便: // // 摘要: // Return a random integer number between min [inclusive] and max [exclusive] (Read // Only). // // 参数: // min: // // max: public static int Range(int min, int max); // // 摘要: // Retu