Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Copy

Copies a range of bits from this array to another range in this array.
Read time 1 minuteLast updated 6 days ago

Definition

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

Copy(int, int, int)

Copies a range of bits from this array to another range in this array.
public void Copy(int dstPos, int srcPos, int numBits)

Parameters

dstPos

Index of the first bit to set.

srcPos

Index of the first bit to copy.

numBits

Number of bits to copy.

Remarks

The bits to copy run from index
srcPos
up to (but not including)
srcPos + numBits
. The bits to set run from index
dstPos
up to (but not including)
dstPos + numBits
.
The ranges may overlap, but the result in the overlapping region is undefined.

Copy(int, NativeBitArray, int, int)

Copies a range of bits from an array to a range of bits in this array.
public void Copy(int dstPos, ref NativeBitArray srcBitArray, int srcPos, int numBits)

Parameters

dstPos

Index of the first bit to set.

srcBitArray

The source array.

srcPos

Index of the first bit to copy.

numBits

The number of bits to copy.

Remarks

The bits to copy in the source array run from index srcPos up to (but not including)
srcPos + numBits
. The bits to set in the destination array run from index dstPos up to (but not including)
dstPos + numBits
.
When the source and destination are the same array, the ranges may still overlap, but the result in the overlapping region is undefined.