docs.unity3d.com
    Show / Hide Table of Contents

    Struct InteractionLayerMask

    Specifies Interaction Layers to use in XR interactions.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    [Serializable]
    public struct InteractionLayerMask : ISerializationCallbackReceiver

    Properties

    value

    Converts an interaction layer mask value to an integer value.

    Declaration
    public int value { get; set; }
    Property Value
    Type Description
    Int32

    Returns the integer value equivalent to this Interaction Layer Mask.

    Methods

    GetMask(String[])

    Given a set of Interaction Layer names, returns the equivalent mask for all of them.

    Declaration
    public static int GetMask(params string[] layerNames)
    Parameters
    Type Name Description
    String[] layerNames

    The interaction layer names to be converted to a mask

    Returns
    Type Description
    Int32

    Returns the equivalent mask for all the supplied Interaction Layer names.

    Exceptions
    Type Condition
    ArgumentNullException

    Throws when layerNames is null.

    LayerToName(Int32)

    Given a layer number, returns the name of the Interaction Layer as defined in either a Builtin or a User Layer.

    Declaration
    public static string LayerToName(int layer)
    Parameters
    Type Name Description
    Int32 layer

    The interaction layer bit index.

    Returns
    Type Description
    String

    Returns the name of the supplied Interaction Layer value.

    NameToLayer(String)

    Given an Interaction Layer name, returns the index as defined by either a Builtin or a User Layer.

    Declaration
    public static int NameToLayer(string layerName)
    Parameters
    Type Name Description
    String layerName

    The interaction layer name.

    Returns
    Type Description
    Int32

    Returns the index of the supplied Interaction Layer name.

    OnAfterDeserialize()

    See ISerializationCallbackReceiver.

    Declaration
    public void OnAfterDeserialize()
    Implements
    ISerializationCallbackReceiver.OnAfterDeserialize()

    OnBeforeSerialize()

    See ISerializationCallbackReceiver.

    Declaration
    public void OnBeforeSerialize()
    Implements
    ISerializationCallbackReceiver.OnBeforeSerialize()

    Operators

    Implicit(Int32 to InteractionLayerMask)

    Implicitly converts an integer to an InteractionLayerMask.

    Declaration
    public static implicit operator InteractionLayerMask(int intVal)
    Parameters
    Type Name Description
    Int32 intVal

    The mask value.

    Returns
    Type Description
    InteractionLayerMask

    Returns the Interaction Layer Mask for the integer value.

    Implicit(InteractionLayerMask to Int32)

    Implicitly converts an InteractionLayerMask to an integer.

    Declaration
    public static implicit operator int (InteractionLayerMask mask)
    Parameters
    Type Name Description
    InteractionLayerMask mask

    The mask to be converted.

    Returns
    Type Description
    Int32

    Returns the integer value of the Interaction Layer Mask.

    Back to top
    Terms of use
    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