NearInteractionTouchable Class

Definition

Add a NearInteractionTouchable to your scene and configure a touchable surface in order to get PointerDown and PointerUp events whenever a PokePointer touches this surface.

C++
public ref class NearInteractionTouchable : Microsoft::MixedReality::Toolkit::Input::NearInteractionTouchableSurface
Inheritance
UnityEngine.MonoBehaviour
NearInteractionTouchable
Attributes
UnityEngine.AddComponentMenuAttribute

Constructors

Fields

Properties

AreLocalVectorsOrthogonal

Returns true if the LocalForward and LocalUp vectors are orthogonal.

Bounds

Bounds or size of the 2D NearInteractionTouchablePlane

ColliderEnabled

Check if the touchableCollider is enabled and in the gameObject hierarchy

DebounceThreshold

Distance in front of the surface at which you will receive a touch completed event.

(Inherited from BaseNearInteractionTouchable)
EventsToReceive

The type of event to receive.

(Inherited from BaseNearInteractionTouchable)
Forward

Forward direction of the gameObject

LocalCenter

Local space object center

LocalForward

Local space forward direction

LocalPressDirection

Forward direction of the NearInteractionTouchable plane, the press direction needs to face the camera.

LocalRight

Local space and gameObject right

LocalUp

Local space up direction

TouchableCollider

BoxCollider used to calculate bounds and local center, if not set before runtime the gameObjects's BoxCollider will be used by default

Methods

DistanceToTouchable(Vector3, Vector3) UnityEngine.MonoBehaviour.DistanceToTouchable(UnityEngine.Vector3,UnityEngine.Vector3@)
OnValidate()
SetBounds(Vector2)

Set the size (bounds) of the 2D NearInteractionTouchable plane.

SetLocalCenter(Vector3)

Set the position (center) of the NearInteractionTouchable plane relative to the gameObject.
The position of the plane should be in front of the gameObject.

SetLocalForward(Vector3)

Set local forward direction and ensure that local up is perpendicular to the new local forward and local right direction. The forward position should be facing the camera. The direction is indicated in scene view by a white arrow in the center of the plane.

SetLocalUp(Vector3)

Set new local up direction and ensure that local forward is perpendicular to the new local up and local right direction.

SetTouchableCollider(BoxCollider)

Adjust the bounds, local center and local forward to match a given box collider. This method also changes the size of the box collider attached to the gameObject. Default Behavior: if touchableCollider is null at runtime, the object's box collider will be used to size and place the NearInteractionTouchable plane in front of the gameObject

Applies to

Produit Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0