Struct InteractionLayerMask
Specifies Interaction Layers to use in XR interactions.
Implements
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Assembly: Unity.XR.Interaction.Toolkit.dll
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 |
---|---|
int | The integer value equivalent to this Interaction Layer Mask. |
Methods
GetMask(params 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 |
---|---|
int | Returns the equivalent mask for all the supplied Interaction Layer names. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Throws when |
LayerToName(int)
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 |
---|---|---|
int | 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 |
---|---|
int | Returns the index of the supplied Interaction Layer name. |
OnAfterDeserialize()
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Declaration
public void OnBeforeSerialize()
Operators
implicit operator InteractionLayerMask(int)
Implicitly converts an integer to an InteractionLayerMask.
Declaration
public static implicit operator InteractionLayerMask(int intVal)
Parameters
Type | Name | Description |
---|---|---|
int | intVal | The mask value. |
Returns
Type | Description |
---|---|
InteractionLayerMask | Returns the Interaction Layer Mask for the integer value. |
implicit operator int(InteractionLayerMask)
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 |
---|---|
int | Returns the integer value of the Interaction Layer Mask. |