UxrPointerInputModule Class

Input module for Unity that enables interaction in virtual reality using either touch gestures (via UxrFingerTip) or laser pointers (via UxrLaserPointer). Using AutoEnableOnWorldCanvases it is possible to automatically set up existing Unity canvases ( Canvas components), otherwise it is required to add a UxrCanvas component on each GameObject having a Canvas to enable interaction.

Inheritance Hierarchy

System.Object
  Object
    Component
      Behaviour
        MonoBehaviour
          UIBehaviour
            BaseInputModule
              PointerInputModule
                UltimateXR.UI.UnityInputModule.UxrPointerInputModule
Namespace: UltimateXR.UI.UnityInputModule
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0

Syntax

C#

public class UxrPointerInputModule : PointerInputModule


The UxrPointerInputModule type exposes the following members.

Constructors

NameDescription
Public methodUxrPointerInputModule

Properties

NameDescription
Public propertyAutoAssignEventCamera Gets whether to assign the event camera to the Canvas components to that they use the local UxrAvatar.
Public propertyAutoEnableOnWorldCanvases Gets whether the input module will try to find all Canvas components after loading a scene, in order to add a UxrCanvas component to those that have not been set up.
Public propertyFingerTipMinHoverDistance Gets the minimum distance from a finger tip to a canvas in order to generate hovering events, when InteractionTypeOnAutoEnable is FingerTips,
Public propertyStatic memberInstance Gets the singleton instance.
Public propertyInteractionTypeOnAutoEnable Gets, for those canvases that have been set up automatically using AutoEnableOnWorldCanvases, the type of interaction that will be used.

Methods

NameDescription
Protected methodAwake Initializes the component. (Overrides UIBehaviour.Awake().)
Protected methodStatic memberFindFirstRaycast Finds the raycast that will be used to find out which UI element the user interacted with.
Public methodGetPointerEventData(UxrFingerTip) Gets the pointer event data of a given UxrFingerTip if it exists.
Public methodGetPointerEventData(UxrLaserPointer) Gets the pointer event data of a given UxrLaserPointer if it exists.
Public methodStatic memberIsInteractive Checks if the given GameObject is interactive. An object is considered interactive when it is able to handle either pointer down or pointer drag events. Since other non-interactive objects may be in front of interactive objects, the whole hierarchy is checked up to the first UxrCanvas found.
Public methodIsModuleSupported (Overrides BaseInputModule.IsModuleSupported().)
Protected methodOnDisable Unsubscribes from events and stops the haptics coroutine. (Overrides BaseInputModule.OnDisable().)
Protected methodOnEnable Subscribes to events and sets up the haptics coroutine. (Overrides BaseInputModule.OnEnable().)
Public methodProcess (Overrides BaseInputModule.Process().)
Protected methodProcessPointerEvents Processes the pointer events.
Protected methodProcessPointerPressRelease Processes the pointer press and release events.
Protected methodStart Sets the drag threshold. (Overrides UIBehaviour.Start().)

Fields

NameDescription
Protected field_autoAssignEventCamera
Protected field_autoEnableOnWorldCanvases
Protected field_disableOtherInputModules
Protected field_dragThreshold
Protected field_fingerTipMinHoverDistance
Protected field_interactionTypeOnAutoEnable

Extension Methods

NameDescription
Public Extension MethodCheckSetEnabled Enables/disabled the component if it isn’t enabled already. (Defined by MonoBehaviourExt.)
Public Extension MethodGetOrAddComponent<T> Gets the Component of a given type. If it doesn’t exist, it is added to the GameObject. (Defined by ComponentExt.)
Public Extension MethodGetPathUnderScene Gets the full path under current scene, including all parents, but scene name, for the given component. (Defined by ComponentExt.)
Public Extension MethodGetSceneUid Gets an unique identifier string for the given component. (Defined by ComponentExt.)
Public Extension MethodGetUniqueScenePath Gets an unique path in the scene for the given component. It will include scene name, sibling and component indices to make it unique. (Defined by ComponentExt.)
Public Extension MethodLoopCoroutine Creates a coroutine that simplifies executing a loop during a certain amount of time. (Defined by MonoBehaviourExt.)
Public Extension MethodSafeGetComponentInParent<T> Gets the Component of a given type in the GameObject or any of its parents. It also works on prefabs, where regular GetComponentInParent(Type, Boolean) will not work: https://issuetracker.unity3d.com/issues/getcomponentinparent-is-returning-null-when-the-gameobject-is-a-prefab (Defined by ComponentExt.)
Public Extension MethodShowInInspector(Boolean)Overloaded.
Controls whether to show the current object in the inspector. (Defined by ObjectExt.)
Public Extension MethodShowInInspector(Boolean, Boolean)Overloaded.
Controls whether to show the current object in the inspector and whether it is editable. (Defined by ObjectExt.)
Public Extension MethodThrowIfNull Throws an exception if the object is null. (Defined by ObjectExt.)

Remarks

Canvas components instantiated at runtime should have a UxrCanvas already present in order for VR interaction to work, since AutoEnableOnWorldCanvases only works for objects present in the scene after loading.

See Also

Reference

UltimateXR.UI.UnityInputModule Namespace