MemClear(m_Buffer, (long)Length * UnsafeUtility.SizeOf<T>()); } public NativeArray(T[] array, Allocator allocator) { if (array == null) throw new ArgumentNullException(nameof(array)); Allocate(array.Length, allocator, out this); Copy(array, this); } public NativeArray(NativeArray<T> ...
MemClear(m_Buffer, (long)Length * UnsafeUtility.SizeOf<T>()); } // C#の配列からコピーする形で初期化 public NativeArray(T[] array, Allocator allocator) { if (array == null) throw new ArgumentNullException(nameof(array)); Allocate(array.Length, allocator, out this); Copy(array, this...
The Unitialized memory part is OK, but the MemClear afterwards causes the problem the recur. //Note the length of memory to clear must be even. //byteArray = new NativeArray<byte>(1024, Allocator.Persistent, NativeArrayOptions.UninitializedMemory); //UnsafeUtility.Mem...