docs.unity3d.com
    Show / Hide Table of Contents

    Class LayerMaskExtensions

    Extension methods for LayerMask structs.

    Inheritance
    Object
    LayerMaskExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.XR.CoreUtils
    Syntax
    public static class LayerMaskExtensions

    Methods

    Contains(LayerMask, Int32)

    Checks whether a layer is in a LayerMask.

    Declaration
    public static bool Contains(this LayerMask mask, int layer)
    Parameters
    Type Name Description
    LayerMask mask

    The layer mask.

    Int32 layer

    The layer index to check for.

    Returns
    Type Description
    Boolean

    True if the specified layer is in this mask.

    GetFirstLayerIndex(LayerMask)

    Gets the index of the first enabled layer in this layerMask.

    Declaration
    public static int GetFirstLayerIndex(this LayerMask layerMask)
    Parameters
    Type Name Description
    LayerMask layerMask

    The layer mask.

    Returns
    Type Description
    Int32

    The index of the first enabled layer.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023