Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetBits

Sets a single bit to 1 or 0.
Read time 1 minuteLast updated 10 days ago

Definition

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

SetBits(int, bool)

Sets a single bit to 1 or 0.
public void SetBits(int pos, bool value)

Parameters

pos

Position in this bit field to set (must be 0-31).

value

If true, sets the bit to 1. If false, sets the bit to 0.

SetBits(int, bool, int)

Sets one or more contiguous bits to 1 or 0.
public void SetBits(int pos, bool value, int numBits)

Parameters

pos

Position in the bit field of the first bit to set (must be 0-31).

value

If true, sets the bits to 1. If false, sets the bits to 0.

numBits

Number of bits to set (must be 1-32).