Class XRUIInputModule
Custom class for input modules that send UI input in XR.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.UI
Syntax
public class XRUIInputModule : UIInputModule
Properties
enableMouseInput
If true, will forward 2D mouse data to UI elements.
Declaration
public bool enableMouseInput { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
enableTouchInput
If true, will forward 2D touch data to UI elements.
Declaration
public bool enableTouchInput { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
enableXRInput
If true, will forward 3D tracked device data to UI elements.
Declaration
public bool enableXRInput { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
maxRaycastDistance
The maximum distance to raycast with tracked devices to find hit objects.
Declaration
public float maxRaycastDistance { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
DoProcess()
Process the current tick for the module.
Declaration
protected override void DoProcess()
Overrides
Remarks
Executed once per Update call. Override for custom processing.
See Also
GetInteractor(Int32)
Gets an IUIInteractor from its corresponding Unity UI Pointer Id. This can be used to identify individual Interactors from the underlying UI Events.
Declaration
public IUIInteractor GetInteractor(int pointerId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | pointerId | A unique integer representing an object that can point at UI. |
Returns
Type | Description |
---|---|
IUIInteractor | Returns the interactor associated with |
GetTrackedDeviceModel(IUIInteractor, out TrackedDeviceModel)
Retrieves the UI Model for a selected IUIInteractor.
Declaration
public bool GetTrackedDeviceModel(IUIInteractor interactor, out TrackedDeviceModel model)
Parameters
Type | Name | Description |
---|---|---|
IUIInteractor | interactor | The IUIInteractor you want the model for. |
TrackedDeviceModel | model | The returned model that reflects the UI state of the |
Returns
Type | Description |
---|---|
Boolean | Returns true if the model was able to retrieved. Otherwise, returns false. |
OnEnable()
Declaration
protected override void OnEnable()
RegisterInteractor(IUIInteractor)
Register an IUIInteractor with the UI system. Calling this will enable it to start interacting with UI.
Declaration
public void RegisterInteractor(IUIInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IUIInteractor | interactor | The IUIInteractor to use. |
UnregisterInteractor(IUIInteractor)
Unregisters an IUIInteractor with the UI system. This cancels all UI Interaction and makes the IUIInteractor no longer able to affect UI.
Declaration
public void UnregisterInteractor(IUIInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IUIInteractor | interactor | The IUIInteractor to stop using. |