# NativeSlice

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

## Definition

* **Type:** Constructor
* **Namespace:** [Unity.Collections](/engine/6000.0/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.CoreModule

## NativeSlice(NativeSlice\<T>, int)

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

```csharp
public NativeSlice(NativeSlice<T> slice, int start)
```

### Parameters

**** (\[NativeSlice\<T>]\(/engine/6000.0/script-reference/unity/collections/nativeslice1)): The [NativeSlice\<T>](/engine/6000.0/script-reference/unity/collections/nativeslice1.md) to use.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): 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.

```csharp
public NativeSlice(NativeSlice<T> slice, int start, int length)
```

### Parameters

**** (\[NativeSlice\<T>]\(/engine/6000.0/script-reference/unity/collections/nativeslice1)): The [NativeSlice\<T>](/engine/6000.0/script-reference/unity/collections/nativeslice1.md) to use.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the first element from the source slice to include in the new slice.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): 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.

```csharp
public NativeSlice(NativeArray<T> array)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): The [NativeArray\<T>](/engine/6000.0/script-reference/unity/collections/nativearray1.md) to use.

### 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.

```csharp
public NativeSlice(NativeArray<T> array, int start)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): The [NativeArray\<T>](/engine/6000.0/script-reference/unity/collections/nativearray1.md) to use.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): 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.

```csharp
public NativeSlice(NativeArray<T> array, int start, int length)
```

### Parameters

**** (\[NativeArray\<T>]\(/engine/6000.0/script-reference/unity/collections/nativearray1)): The [NativeArray\<T>](/engine/6000.0/script-reference/unity/collections/nativearray1.md) to use.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index of the first element from the source to include in the slice.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): 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.
