Version: Unity 6.0 (6000.0)
LanguageEnglish
  • C#

NativeSlice<T0> Constructor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Constructs a new NativeSlice from a NativeArray or NativeSlice.


Declaration

public NativeSlice<T0>(NativeArray<T> array);

Parameters

Parameter Description
array The NativeArray<T0> to use.

Description

Constructs a new NativeSlice from a NativeArray.

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


Declaration

public NativeSlice<T0>(NativeArray<T> array, int start);

Parameters

Parameter Description
array The NativeArray<T0> to use.
start The index of the first element from the source to include in the slice.

Description

Constructs a new NativeSlice from a NativeArray, with a defined start index.

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


Declaration

public NativeSlice<T0>(NativeArray<T> array, int start, int length);

Parameters

Parameter Description
array The NativeArray<T0> to use.
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.

Description

Constructs a new NativeSlice of defined length length, from a NativeArray with a defined start index.

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.


Declaration

public NativeSlice<T0>(NativeSlice<T> slice, int start);

Parameters

Parameter Description
slice The NativeSlice<T0> to use.
start The index of the first element from the source slice to include in the new slice.

Description

Constructs a new NativeSlice from another NativeSlice, with a defined start index.

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


Declaration

public NativeSlice<T0>(NativeSlice<T> slice, int start, int length);

Parameters

Parameter Description
slice The NativeSlice<T0> to use.
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.

Description

Constructs a new NativeSlice of defined length length, from another NativeSlice, with a defined start index.

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.