Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Copy

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
Read time 6 minutesLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule

Copy(NativeArray<T>, NativeArray<T>)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T> src, NativeArray<T> dst)

Parameters

The data to copy.

The array that receives the data.

Copy(ReadOnly, NativeArray<T>)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T>.ReadOnly src, NativeArray<T> dst)

Parameters

The data to copy.

The array that receives the data.

Copy(`0[], NativeArray<T>)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(T[] src, NativeArray<T> dst)

Parameters

The data to copy.

The array that receives the data.

Copy(NativeArray<T>, `0[])

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T> src, T[] dst)

Parameters

The data to copy.

The array that receives the data.

Copy(ReadOnly, `0[])

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T>.ReadOnly src, T[] dst)

Parameters

The data to copy.

The array that receives the data.

Copy(NativeArray<T>, NativeArray<T>, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T> src, NativeArray<T> dst, int length)

Parameters

The data to copy.

The array that receives the data.

length

A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

Copy(ReadOnly, NativeArray<T>, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T>.ReadOnly src, NativeArray<T> dst, int length)

Parameters

The data to copy.

The array that receives the data.

length

Copy(`0[], NativeArray<T>, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(T[] src, NativeArray<T> dst, int length)

Parameters

The data to copy.

The array that receives the data.

length

A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

Copy(NativeArray<T>, `0[], int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T> src, T[] dst, int length)

Parameters

The data to copy.

The array that receives the data.

length

A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

Copy(ReadOnly, `0[], int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T>.ReadOnly src, T[] dst, int length)

Parameters

The data to copy.

The array that receives the data.

length

Copy(NativeArray<T>, int, NativeArray<T>, int, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T> src, int srcIndex, NativeArray<T> dst, int dstIndex, int length)

Parameters

The data to copy.

srcIndex

A 32-bit integer that represents the index in the
src
array where copying begins.

The array that receives the data.

dstIndex

A 32-bit integer that represents the index in the
dst
array where storing begins.

length

A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

Copy(ReadOnly, int, NativeArray<T>, int, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T>.ReadOnly src, int srcIndex, NativeArray<T> dst, int dstIndex, int length)

Parameters

The data to copy.

srcIndex


The array that receives the data.

dstIndex


length

Copy(`0[], int, NativeArray<T>, int, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(T[] src, int srcIndex, NativeArray<T> dst, int dstIndex, int length)

Parameters

The data to copy.

srcIndex

A 32-bit integer that represents the index in the
src
array where copying begins.

The array that receives the data.

dstIndex

A 32-bit integer that represents the index in the
dst
array where storing begins.

length

A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

Copy(NativeArray<T>, int, `0[], int, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T> src, int srcIndex, T[] dst, int dstIndex, int length)

Parameters

The data to copy.

srcIndex

A 32-bit integer that represents the index in the
src
array where copying begins.

The array that receives the data.

dstIndex

A 32-bit integer that represents the index in the
dst
array where storing begins.

length

A 32-bit integer that represents the number of elements to copy. The integer must be equal to or greater than zero.

Copy(ReadOnly, int, `0[], int, int)

Copies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.
public static void Copy(NativeArray<T>.ReadOnly src, int srcIndex, T[] dst, int dstIndex, int length)

Parameters

The data to copy.

srcIndex


The array that receives the data.

dstIndex


length