{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct BitField32 | Collections | 2.3.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)