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

PointableCanvasModule Class

Extends PointerInputModule
PointableCanvasModule is a context-like object which exists in the scene and handles routing for certain types of PointerEvents, translating them into Unity pointer events which can be routed to and consumed by Unity Canvases.
PointableCanvas requires that the scene contain a PointableCanvasModule.

Protected Fields

_started : bool
Signature
bool Oculus.Interaction.PointableCanvasModule._started

Properties

ExclusiveMode : bool
[Get][Set]
If true, this module will disable other input modules in the event system and will be the only input module used in the scene.
Signature
bool Oculus.Interaction.PointableCanvasModule.ExclusiveMode

Events

WhenPointerStarted : Action< Pointer >
Global event invoked whenever a new Pointer is started.
Though this event itself is static, it is invoked by the PointableCanvasModule instance in the scene as part of Process.
Signature
Action<Pointer> Oculus.Interaction.PointableCanvasModule.WhenPointerStarted
WhenSelectableHovered : Action< PointableCanvasEventArgs >
Global event invoked in response to a PointerEventType.Hover on an IPointableCanvas.
Though this event itself is static, it is invoked by the PointableCanvasModule instance in the scene as part of Process.
Signature
Action<PointableCanvasEventArgs> Oculus.Interaction.PointableCanvasModule.WhenSelectableHovered
WhenSelectableUnhovered : Action< PointableCanvasEventArgs >
Global event invoked in response to a PointerEventType.Unhover on an IPointableCanvas.
Though this event itself is static, it is invoked by the PointableCanvasModule instance in the scene as part of Process.
Signature
Action<PointableCanvasEventArgs> Oculus.Interaction.PointableCanvasModule.WhenSelectableUnhovered
WhenSelected : Action< PointableCanvasEventArgs >
Global event invoked in response to a PointerEventType.Select on an IPointableCanvas.
Though this event itself is static, it is invoked by the PointableCanvasModule instance in the scene as part of Process.
Signature
Action<PointableCanvasEventArgs> Oculus.Interaction.PointableCanvasModule.WhenSelected
WhenUnselected : Action< PointableCanvasEventArgs >
Global event invoked in response to a PointerEventType.Unselect on an IPointableCanvas.
Though this event itself is static, it is invoked by the PointableCanvasModule instance in the scene as part of Process.
Signature
Action<PointableCanvasEventArgs> Oculus.Interaction.PointableCanvasModule.WhenUnselected

Protected Methods

Awake ()
Signature
override void Oculus.Interaction.PointableCanvasModule.Awake()
Returns
override void
OnDestroy ()
Signature
override void Oculus.Interaction.PointableCanvasModule.OnDestroy()
Returns
override void
OnDisable ()
Signature
override void Oculus.Interaction.PointableCanvasModule.OnDisable()
Returns
override void
OnEnable ()
Signature
override void Oculus.Interaction.PointableCanvasModule.OnEnable()
Returns
override void
ProcessDrag ( pointerEvent )
Override of PointerInputModule's ProcessDrag to allow using the initial press position for drag begin.
Set _useInitialPressPositionForDrag to false if you prefer the default behaviour of PointerInputModule.
Signature
override void Oculus.Interaction.PointableCanvasModule.ProcessDrag(PointerEventData pointerEvent)
Parameters
pointerEvent: PointerEventData
Returns
override void
Start ()
Signature
override void Oculus.Interaction.PointableCanvasModule.Start()
Returns
override void
UpdatePointerEventData ( pointerEvent , pressed , released )
This method is based on ProcessTouchPoint in StandaloneInputModule, but is instead used for Pointer events
Signature
void Oculus.Interaction.PointableCanvasModule.UpdatePointerEventData(PointerEventData pointerEvent, bool pressed, bool released)
Parameters
pointerEvent: PointerEventData
pressed: bool
released: bool
Returns
void

Methods

Process ()
This is an internal API which is invoked to process input.
This overrides the Process() method of Unity's BaseInputModule, from which PointableCanvasModule is descended, and should not be invoked manually.
Signature
override void Oculus.Interaction.PointableCanvasModule.Process()
Returns
override void
UpdateModule ()
This is an internal API which is invoked to update the PointableCanvasModule.
This overrides the UpdateModule() method of Unity's BaseInputModule, from which PointableCanvasModule is descended, and should not be invoked directly.
Signature
override void Oculus.Interaction.PointableCanvasModule.UpdateModule()
Returns
override void

Protected Static Methods

FindFirstRaycastWithinCanvas ( candidates , canvas )
Signature
static RaycastResult Oculus.Interaction.PointableCanvasModule.FindFirstRaycastWithinCanvas(List< RaycastResult > candidates, Canvas canvas)
Parameters
candidates: List< RaycastResult >
canvas: Canvas
Returns
RaycastResult
ShouldStartDrag ( pressPos , currentPos , threshold , useDragThreshold )
Used in PointerInputModule's ProcessDrag implementation.
Brought into this subclass with a protected signature (as opposed to the parent's private signature) to be used in this subclass's overridden ProcessDrag.
Signature
static bool Oculus.Interaction.PointableCanvasModule.ShouldStartDrag(Vector2 pressPos, Vector2 currentPos, float threshold, bool useDragThreshold)
Parameters
pressPos: Vector2
currentPos: Vector2
threshold: float
useDragThreshold: bool
Returns
bool

Static Methods

RegisterPointableCanvas ( pointerCanvas )
Registers an IPointableCanvas with the PointableCanvasModule in the scene so that its PointerEvents can be correctly handled, converted, and forwarded.
Signature
static void Oculus.Interaction.PointableCanvasModule.RegisterPointableCanvas(IPointableCanvas pointerCanvas)
Parameters
pointerCanvas: IPointableCanvas  The IPointableCanvas to register
Returns
void
UnregisterPointableCanvas ( pointerCanvas )
Unregisters an IPointableCanvas with the PointableCanvasModule in the scene.
PointerEvents from that canvas will no longer be propagated to the Unity Canvas.
Signature
static void Oculus.Interaction.PointableCanvasModule.UnregisterPointableCanvas(IPointableCanvas pointerCanvas)
Parameters
pointerCanvas: IPointableCanvas  The IPointableCanvas to unregister
Returns
void

Inner Class

Pointer Class

Representation of an ongoing interaction between a PointerInteractor<TInteractor, TInteractable> and the PointerInteractable<TInteractor, TInteractable>s at which it points.
Instance of this can be observed and leveraged to add pointer interaction functionality no built into PointableCanvasModule, such as scrolling based on controller thumbsticks.

Properties

Identifier : int
[Get]
The PointerEvent.Identifier of the PointerEvents which control the state of this Pointer.
Canonically, this will be the same as the IInteractorView.Identifier of the actuating interactor.
Signature
int Oculus.Interaction.PointableCanvasModule.Pointer.Identifier

Events

WhenDisposed : Action
Invoked when the pointer is being disposed.
Observers can use this signal to clean up any references or resources they may have retained related to this Pointer.
Signature
Action Oculus.Interaction.PointableCanvasModule.Pointer.WhenDisposed
WhenUpdated : Action< PointerEventData >
Invoked when the Pointer has been updated, exposing the PointerEventData representing what PointableCanvasModule does and knows about this Pointer's behavior.
PointerEventData is exposed here in order to be leveraged in extending functionality, such as scrolling support. However, modifying this data is not supported and can result in unexpected behavior. Rather than modifying this data, consumers should copy relevant information to their own PointerEventData instances and use those to execute events. For similar reasons, references to this PointerEventData should not be cached off or accessed except during the WhenUpdated callback itself.
Signature
Action<PointerEventData> Oculus.Interaction.PointableCanvasModule.Pointer.WhenUpdated