public void Init() { rng = (Random *)UnsafeUtility.Malloc(UnsafeUtility.SizeOf <Random>() * 10000, UnsafeUtility.AlignOf <Random>(), Allocator.Persistent); for (int i = 0; i < 10000; ++i) { rng[i] = new Unity.Mathematics.Random(1); } f = (double3 *)UnsafeUtility.Malloc(UnsafeUtility.SizeOf <double3>() * 10000, UnsafeUtility.AlignOf <double3>(), Allocator.Persistent); for (int i = 0; i < 10000; ++i) { f[i] = new double3(0.0); } }
public void Init() { rng = (Random *)UnsafeUtility.Malloc(UnsafeUtility.SizeOf <Random>() * 10000, UnsafeUtility.AlignOf <Random>(), Allocator.Persistent); for (int i = 0; i < 10000; ++i) { rng[i] = new Unity.Mathematics.Random(1); } u = (uint4 *)UnsafeUtility.Malloc(UnsafeUtility.SizeOf <uint4>() * 10000, UnsafeUtility.AlignOf <uint4>(), Allocator.Persistent); for (int i = 0; i < 10000; ++i) { u[i] = 0; } }