Пример #1
0
        public NativeArray(T[] array, Allocator allocMode)
        {
            if (array == null)
            {
                throw new ArgumentNullException("array");
            }
            NativeArray <T> .Allocate(array.Length, allocMode, out this);

            this.FromArray(array);
        }
Пример #2
0
        public NativeArray(NativeArray <T> array, Allocator allocMode)
        {
            NativeArray <T> .Allocate(array.Length, allocMode, out this);

            this.CopyFrom(array);
        }
Пример #3
0
 public NativeArray(int length, Allocator allocMode)
 {
     NativeArray <T> .Allocate(length, allocMode, out this);
 }
Пример #4
0
        public NativeArray(int length, Allocator allocMode)
        {
            NativeArray <T> .Allocate(length, allocMode, out this);

            UnsafeUtility.MemClear(this.m_Buffer, this.Length * UnsafeUtility.SizeOf <T>());
        }