API reference
API reference
Select your platform
No SDKs available
No versions available

PointerInteractable Class

PointerInteractable provides a base template for any kind of interaction which can be characterized as, "pointing at something." Interactables of this kind, examples of which include PokeInteractable and RayInteractable, receive PointerEvents from interacting TInteractor s and re-emit those events to describe their behavior during interaction, in addition to the signals and data provided by Interactable<TInteractor, TInteractable>s.
Like Interactable<TInteractor, TInteractable>, this type has a curiously recurring generic argument TInteractable , which should be the concrete interactable type which derives from this type and is uniquely associated with TInteractor .

Properties

The "think which can be pointed at" associated with this pointer interactable.
This property is typically set through the UnityEditor and populated from there during MonoBehaviour start-up, but it can also be set programmatically using InjectOptionalPointableElement(IPointableElement). This property is optional can can return null. For example, a RayInteractable might have a PointableCanvas with which one can interact by pointing a RayInteractor's ray at it, in which case the canvas would be the PointableElement.

Events

Implementation of IPointable.WhenPointerEventRaised; for details, please refer to the related documentation provided for that interface.

Member Functions

Internal API which publishes the provided PointerEvent, making sure that PointableElement has the first opportunity to handle the event before it is emitted more broadly via WhenPointerEventRaised.
This method is automatically invoked by PointerInteractor<TInteractor, TInteractable> as part of the PointerEvent propagation process, and it should not be called directly from outside that process.
Parameters
evt
Sets the PointableElement on a dynamically instantiated GameObject.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.

Protected Functions

virtual override void Awake ( )
virtual override void Start ( )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon