Struct InteractionLayerMask
Specifies Interaction Layers to use in XR interactions.
Inherited Members
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 |
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()
Declaration
public void OnAfterDeserialize()
Implements
OnBeforeSerialize()
Declaration
public void OnBeforeSerialize()
Implements
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. |