Struct BitField32
A 32-bit array of bits.
Namespace: Unity.Collections
Assembly: solution.dll
Syntax
public struct BitField32
Remarks
Stack allocated, so it does not require thread safety checks or disposal.
Constructors
| Name | Description |
|---|---|
| BitField32(uint) | Initializes and returns an instance of BitField32. |
Fields
| Name | Description |
|---|---|
| Value | The 32 bits, stored as a uint. |
Methods
| Name | Description |
|---|---|
| Clear() | Clears all the bits to 0. |
| CountBits() | Returns the number of bits that are 1. |
| CountLeadingZeros() | Returns the number of leading zeroes. |
| CountTrailingZeros() | Returns the number of trailing zeros. |
| GetBits(int, int) | Returns one or more contiguous bits from the bit field as the lower bits of a uint. |
| IsSet(int) | Returns true if the bit at a position is 1. |
| SetBits(int, bool) | Sets a single bit to 1 or 0. |
| SetBits(int, bool, int) | Sets one or more contiguous bits to 1 or 0. |