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
Name | Description | |
---|---|---|
UxrPointerInputModule |
Properties
Name | Description | |
---|---|---|
AutoAssignEventCamera | Gets whether to assign the event camera to the Canvas components to that they use the local UxrAvatar. | |
AutoEnableOnWorldCanvases | 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. | |
FingerTipMinHoverDistance | Gets the minimum distance from a finger tip to a canvas in order to generate hovering events, when InteractionTypeOnAutoEnable is FingerTips, | |
Instance | Gets the singleton instance. | |
InteractionTypeOnAutoEnable | Gets, for those canvases that have been set up automatically using AutoEnableOnWorldCanvases, the type of interaction that will be used. |
Methods
Name | Description | |
---|---|---|
Awake | Initializes the component. (Overrides UIBehaviour.Awake().) | |
FindFirstRaycast | Finds the raycast that will be used to find out which UI element the user interacted with. | |
GetPointerEventData(UxrFingerTip) | Gets the pointer event data of a given UxrFingerTip if it exists. | |
GetPointerEventData(UxrLaserPointer) | Gets the pointer event data of a given UxrLaserPointer if it exists. | |
IsInteractive | 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. | |
IsModuleSupported | (Overrides BaseInputModule.IsModuleSupported().) | |
OnDisable | Unsubscribes from events and stops the haptics coroutine. (Overrides BaseInputModule.OnDisable().) | |
OnEnable | Subscribes to events and sets up the haptics coroutine. (Overrides BaseInputModule.OnEnable().) | |
Process | (Overrides BaseInputModule.Process().) | |
ProcessPointerEvents | Processes the pointer events. | |
ProcessPointerPressRelease | Processes the pointer press and release events. | |
Start | Sets the drag threshold. (Overrides UIBehaviour.Start().) |
Fields
Name | Description | |
---|---|---|
_autoAssignEventCamera | ||
_autoEnableOnWorldCanvases | ||
_disableOtherInputModules | ||
_dragThreshold | ||
_fingerTipMinHoverDistance | ||
_interactionTypeOnAutoEnable |
Extension Methods
Name | Description | |
---|---|---|
CheckSetEnabled | Enables/disabled the component if it isn’t enabled already. (Defined by MonoBehaviourExt.) | |
GetOrAddComponent<T> | Gets the Component of a given type. If it doesn’t exist, it is added to the GameObject. (Defined by ComponentExt.) | |
GetPathUnderScene | Gets the full path under current scene, including all parents, but scene name, for the given component. (Defined by ComponentExt.) | |
GetSceneUid | Gets an unique identifier string for the given component. (Defined by ComponentExt.) | |
GetUniqueScenePath | 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.) | |
LoopCoroutine | Creates a coroutine that simplifies executing a loop during a certain amount of time. (Defined by MonoBehaviourExt.) | |
SafeGetComponentInParent<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.) | |
ShowInInspector(Boolean) | Overloaded. Controls whether to show the current object in the inspector. (Defined by ObjectExt.) | |
ShowInInspector(Boolean, Boolean) | Overloaded. Controls whether to show the current object in the inspector and whether it is editable. (Defined by ObjectExt.) | |
ThrowIfNull | 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.