Class XRUIInputModule
Custom class for input modules that send UI input in XR.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.UI
Syntax
[AddComponentMenu("Event/XR UI Input Module", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.0/api/UnityEngine.XR.Interaction.Toolkit.UI.XRUIInputModule.html")]
public class XRUIInputModule : UIInputModule
Properties
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 |
enableGamepadInput
If true, will forward gamepad data to UI elements.
Declaration
public bool enableGamepadInput { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
enableJoystickInput
If true, will forward joystick data to UI elements.
Declaration
public bool enableJoystickInput { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
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 |
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 |
maxRaycastDistance
The maximum distance to ray cast with tracked devices to find hit objects.
Declaration
[Obsolete("maxRaycastDistance has been deprecated. Its value was unused, calling this property is unnecessary and should be removed.")]
public float maxRaycastDistance { get; set; }
Property Value
Type | Description |
---|---|
Single |
Remarks
maxRaycastDistance
has been deprecated. Its value was unused, calling this property is unnecessary and should be removed.
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(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. |
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. |