public IBufferArray Resize(int newSize)
        {
            var newArr = new NativeArray <T>(newSize, Allocator.Persistent);

            if (this.arr.IsCreated == true)
            {
                NativeArrayUtils.Copy(this.arr, ref newArr, newSize > this.Length ? this.Length : newSize);
            }
            return(new NativeBufferArray <T>(newArr, newSize));
        }
Beispiel #2
0
        public NativeArrayBurst(NativeArrayBurst <T> array, Allocator allocator)
        {
            NativeArrayBurst <T> .Allocate(array.Length, allocator, out this);

            NativeArrayUtils.Copy(array, ref this);
        }