{!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} Method SetBits | Collections | 2.3.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SetBits

    SetBits(int, bool)

    Sets a single bit to 1 or 0.

    Declaration
    public void SetBits(int pos, bool value)
    Parameters
    Type Name Description
    int pos

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

    bool value

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

    Exceptions
    Type Condition
    ArgumentException

    Thrown if posis out of range.

    SetBits(int, bool, int)

    Sets one or more contiguous bits to 1 or 0.

    Declaration
    public void SetBits(int pos, bool value, int numBits)
    Parameters
    Type Name Description
    int pos

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

    bool value

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

    int numBits

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

    Exceptions
    Type Condition
    ArgumentException

    Thrown if pos or numBits are out of bounds or if pos + numBits exceeds 32.

    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)