mrtk_developmentreleases/2.0.0releases/2.1.0releases/2.2.0

    Show / Hide Table of Contents

    Class LayerExtensions

    Extension methods for Unity's LayerMask struct

    Inheritance
    Object
    LayerExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.MixedReality.Toolkit
    Assembly: cs.temp.dll.dll
    Syntax
    public static class LayerExtensions

    Fields

    InvalidLayerId

    The Invalid Layer Id.

    Declaration
    public const int InvalidLayerId = -1
    Field Value
    Type Description
    Int32

    InvalidLayerId

    The Invalid Layer Id.

    Declaration
    public const int InvalidLayerId = -1
    Field Value
    Type Description
    Int32

    Methods

    Combine(LayerMask[])

    Combines provided layers into a single layer mask.

    Declaration
    public static int Combine(this LayerMask[] layerMaskList)
    Parameters
    Type Name Description
    LayerMask[] layerMaskList
    Returns
    Type Description
    Int32

    The combined layer mask

    Combine(LayerMask[])

    Combines provided layers into a single layer mask.

    Declaration
    public static int Combine(this LayerMask[] layerMaskList)
    Parameters
    Type Name Description
    LayerMask[] layerMaskList
    Returns
    Type Description
    Int32

    The combined layer mask

    FindLayerListIndex(Int32, LayerMask[])

    Look through the layerMaskList and find the index in that list for which the supplied layer is part of

    Declaration
    public static int FindLayerListIndex(this int layer, LayerMask[] layerMasks)
    Parameters
    Type Name Description
    Int32 layer

    Layer to search for

    LayerMask[] layerMasks

    List of LayerMasks to search

    Returns
    Type Description
    Int32

    LayerMaskList index, or -1 for not found

    FindLayerListIndex(Int32, LayerMask[])

    Look through the layerMaskList and find the index in that list for which the supplied layer is part of

    Declaration
    public static int FindLayerListIndex(this int layer, LayerMask[] layerMasks)
    Parameters
    Type Name Description
    Int32 layer

    Layer to search for

    LayerMask[] layerMasks

    List of LayerMasks to search

    Returns
    Type Description
    Int32

    LayerMaskList index, or -1 for not found

    GetLayerId(ref Int32, String)

    Gets a valid layer id using the layer name.

    Declaration
    public static int GetLayerId(ref int cache, string layerName)
    Parameters
    Type Name Description
    Int32 cache

    The cached layer id.

    String layerName

    The name of the layer to look for if the cache is unset.

    Returns
    Type Description
    Int32

    The layer id.

    GetLayerId(ref Int32, String)

    Gets a valid layer id using the layer name.

    Declaration
    public static int GetLayerId(ref int cache, string layerName)
    Parameters
    Type Name Description
    Int32 cache

    The cached layer id.

    String layerName

    The name of the layer to look for if the cache is unset.

    Returns
    Type Description
    Int32

    The layer id.

    IsInLayerMask(Int32, Int32)

    Checks whether a layer is in a layer mask

    Declaration
    public static bool IsInLayerMask(this int layer, int layerMask)
    Parameters
    Type Name Description
    Int32 layer
    Int32 layerMask
    Returns
    Type Description
    Boolean

    True if the layer mask contains the layer

    IsInLayerMask(Int32, Int32)

    Checks whether a layer is in a layer mask

    Declaration
    public static bool IsInLayerMask(this int layer, int layerMask)
    Parameters
    Type Name Description
    Int32 layer
    Int32 layerMask
    Returns
    Type Description
    Boolean

    True if the layer mask contains the layer

    ToMask(Int32)

    Transform layer id to LayerMask

    Declaration
    public static LayerMask ToMask(int layerId)
    Parameters
    Type Name Description
    Int32 layerId
    Returns
    Type Description
    LayerMask

    ToMask(Int32)

    Transform layer id to LayerMask

    Declaration
    public static LayerMask ToMask(int layerId)
    Parameters
    Type Name Description
    Int32 layerId
    Returns
    Type Description
    LayerMask
    In This Article
    • Fields
      • InvalidLayerId
      • InvalidLayerId
    • Methods
      • Combine(LayerMask[])
      • Combine(LayerMask[])
      • FindLayerListIndex(Int32, LayerMask[])
      • FindLayerListIndex(Int32, LayerMask[])
      • GetLayerId(ref Int32, String)
      • GetLayerId(ref Int32, String)
      • IsInLayerMask(Int32, Int32)
      • IsInLayerMask(Int32, Int32)
      • ToMask(Int32)
      • ToMask(Int32)
    Back to top Generated by DocFX