docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method HasFlag

    HasFlag<T>(T, T)

    Bitfield flag test.

    Declaration
    public static bool HasFlag<T>(T mask, T flag) where T : IConvertible
    Parameters
    Type Name Description
    T mask

    Bitfield to test the flag against.

    T flag

    Flag to be tested against the provided mask.

    Returns
    Type Description
    bool

    True if the flag is present in the mask.

    Type Parameters
    Name Description
    T

    Type of the enum flag.

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