Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


NativeSlice

Constructs a new NativeSlice from another NativeSlice, with a defined start index.
Read time 2 minutesLast updated 10 days ago

Definition

NativeSlice(NativeSlice<T>, int)

Constructs a new NativeSlice from another NativeSlice, with a defined start index.
public NativeSlice(NativeSlice<T> slice, int start)

Parameters


start

The index of the first element from the source slice to include in the new slice.

Remarks

Constructs a new
NativeSlice
that provides a view over the memory of another existing
NativeSlice
, beginning at a specified starting index.

NativeSlice(NativeSlice<T>, int, int)

Constructs a new NativeSlice of defined length
length
, from another NativeSlice, with a defined start index.
public NativeSlice(NativeSlice<T> slice, int start, int length)

Parameters


start

The index of the first element from the source slice to include in the new slice.

length

The number of elements that the new NativeSlice will have.

Remarks

Constructs a new
NativeSlice
that provides a view over a defined sub-region of another existing
NativeSlice
, beginning at a specified starting index and covering an exact number of elements.

NativeSlice(NativeArray<T>)

Constructs a new NativeSlice from a NativeArray.
public NativeSlice(NativeArray<T> array)

Parameters

Remarks

Constructs a new NativeSlice from a NativeArray or NativeSlice.
Constructs a new
NativeSlice
that provides a view over the memory of the specified
NativeArray
.

NativeSlice(NativeArray<T>, int)

Constructs a new NativeSlice from a NativeArray, with a defined start index.
public NativeSlice(NativeArray<T> array, int start)

Parameters


start

The index of the first element from the source to include in the slice.

Remarks

Constructs a new
NativeSlice
that provides a view over the memory of the specified
NativeArray
, beginning at a specified starting index.

NativeSlice(NativeArray<T>, int, int)

Constructs a new NativeSlice of defined length
length
, from a NativeArray with a defined start index.
public NativeSlice(NativeArray<T> array, int start, int length)

Parameters


start

The index of the first element from the source to include in the slice.

length

The number of elements that the new NativeSlice will have.

Remarks

Constructs a new
NativeSlice
that provides a view over a sub-region of the specified
NativeArray
, beginning at a specified starting index and covering a specific number of elements.