Answers for "unity random seed"

C#
0

unity random seed

using UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour {
    private float[] noiseValues;
    void Start() {
        Random.seed = 42;
        noiseValues = new float[10];
        int i = 0;
        while (i < noiseValues.Length) {
            noiseValues[i] = Random.value;
            print(noiseValues[i]);
            i++;
        }
    }
}
Posted by: Guest on November-25-2020

C# Answers by Framework

Browse Popular Code Answers by Language