Class XRUIInputModule
Custom class for input modules that send UI input in XR.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.UI
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("Event/XR UI Input Module", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.6/api/UnityEngine.XR.Interaction.Toolkit.UI.XRUIInputModule.html")]
public class XRUIInputModule : UIInputModule
Properties
activeInputMode
Configures which Active Input Mode will be used in the situation where the Active Input Handling project setting is set to Both.
Declaration
public XRUIInputModule.ActiveInputMode activeInputMode { get; set; }
Property Value
| Type | Description |
|---|---|
| XRUIInputModule.ActiveInputMode |
See Also
cancelAction
The Input System action to use for cancelling or backing out of a UI element. Must be a UnityEngine.InputSystem.Controls.ButtonControl Control.
Declaration
public InputActionReference cancelAction { get; set; }
Property Value
| Type | Description |
|---|---|
| InputActionReference |
cancelButton
Name of the gamepad/joystick button to use for UI cancel or back commands when using the old Input Manager.
Declaration
public string cancelButton { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
enableBuiltinActionsAsFallback
When enabled, built-in Input System actions will be used if no Input System UI Actions are assigned. This uses the currently enabled Input System devices: UnityEngine.InputSystem.Mouse.current, UnityEngine.InputSystem.Gamepad.current, and UnityEngine.InputSystem.Joystick.current.
Declaration
public bool enableBuiltinActionsAsFallback { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
enableGamepadInput
If true, will forward gamepad data to UI elements.
Declaration
public bool enableGamepadInput { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
enableJoystickInput
If true, will forward joystick data to UI elements.
Declaration
public bool enableJoystickInput { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
enableMouseInput
If true, will forward 2D mouse data to UI elements.
Declaration
public bool enableMouseInput { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
enableTouchInput
If true, will forward 2D touch data to UI elements.
Declaration
public bool enableTouchInput { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
enableXRInput
If true, will forward 3D tracked device data to UI elements.
Declaration
public bool enableXRInput { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
horizontalAxis
Name of the horizontal axis for UI navigation when using the old Input Manager.
Declaration
public string horizontalAxis { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
leftClickAction
The Input System action to use to determine whether the left button of a pointer is pressed. Must be a UnityEngine.InputSystem.Controls.ButtonControl Control.
Declaration
public InputActionReference leftClickAction { get; set; }
Property Value
| Type | Description |
|---|---|
| InputActionReference |
middleClickAction
The Input System action to use to determine whether the middle button of a pointer is pressed. Must be a UnityEngine.InputSystem.Controls.ButtonControl Control.
Declaration
public InputActionReference middleClickAction { get; set; }
Property Value
| Type | Description |
|---|---|
| InputActionReference |
navigateAction
The Input System action to use to navigate the currently active UI. Must be a UnityEngine.InputSystem.Controls.Vector2Control Control.
Declaration
public InputActionReference navigateAction { get; set; }
Property Value
| Type | Description |
|---|---|
| InputActionReference |
pointAction
The Input System action to use to move the pointer on the currently active UI. Must be a UnityEngine.InputSystem.Controls.Vector2Control Control.
Declaration
public InputActionReference pointAction { get; set; }
Property Value
| Type | Description |
|---|---|
| InputActionReference |
rightClickAction
The Input System action to use to determine whether the right button of a pointer is pressed. Must be a UnityEngine.InputSystem.Controls.ButtonControl Control.
Declaration
public InputActionReference rightClickAction { get; set; }
Property Value
| Type | Description |
|---|---|
| InputActionReference |
scrollWheelAction
The Input System action to use to move the pointer on the currently active UI. Must be a UnityEngine.InputSystem.Controls.Vector2Control Control.
Declaration
public InputActionReference scrollWheelAction { get; set; }
Property Value
| Type | Description |
|---|---|
| InputActionReference |
submitAction
The Input System action to use for submitting or activating a UI element. Must be a UnityEngine.InputSystem.Controls.ButtonControl Control.
Declaration
public InputActionReference submitAction { get; set; }
Property Value
| Type | Description |
|---|---|
| InputActionReference |
submitButton
Name of the gamepad/joystick button to use for UI selection or submission when using the old Input Manager.
Declaration
public string submitButton { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
verticalAxis
Name of the vertical axis for UI navigation when using the old Input Manager.
Declaration
public string verticalAxis { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
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(int)
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 |
|---|---|---|
| int | 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 |
|---|---|
| bool | Returns true if the model was able to retrieved. Otherwise, returns false. |
OnDisable()
Declaration
protected override void OnDisable()
Overrides
OnEnable()
Declaration
protected override void OnEnable()
Overrides
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. |