docs.unity3d.com
    Show / Hide Table of Contents

    Class XRUIInputModule

    Custom class for input modules that send UI input in XR.

    Inheritance
    Object
    UIBehaviour
    BaseInputModule
    UIInputModule
    XRUIInputModule
    Inherited Members
    UIInputModule.clickSpeed
    UIInputModule.moveDeadzone
    UIInputModule.repeatDelay
    UIInputModule.repeatRate
    UIInputModule.trackedDeviceDragThresholdMultiplier
    UIInputModule.uiCamera
    UIInputModule.Update()
    UIInputModule.Process()
    UIInputModule.SendUpdateEventToSelectedObject()
    UIInputModule.IsPointerOverGameObject(Int32)
    UIInputModule.finalizeRaycastResults
    UIInputModule.pointerEnter
    UIInputModule.pointerExit
    UIInputModule.pointerDown
    UIInputModule.pointerUp
    UIInputModule.pointerClick
    UIInputModule.pointerMove
    UIInputModule.initializePotentialDrag
    UIInputModule.beginDrag
    UIInputModule.drag
    UIInputModule.endDrag
    UIInputModule.drop
    UIInputModule.scroll
    UIInputModule.updateSelected
    UIInputModule.move
    UIInputModule.submit
    UIInputModule.cancel
    BaseInputModule.m_RaycastResultCache
    BaseInputModule.m_InputOverride
    BaseInputModule.FindFirstRaycast(List<RaycastResult>)
    BaseInputModule.DetermineMoveDirection(Single, Single)
    BaseInputModule.DetermineMoveDirection(Single, Single, Single)
    BaseInputModule.FindCommonRoot(GameObject, GameObject)
    BaseInputModule.HandlePointerExitAndEnter(PointerEventData, GameObject)
    BaseInputModule.GetAxisEventData(Single, Single, Single)
    BaseInputModule.GetBaseEventData()
    BaseInputModule.ShouldActivateModule()
    BaseInputModule.DeactivateModule()
    BaseInputModule.ActivateModule()
    BaseInputModule.UpdateModule()
    BaseInputModule.IsModuleSupported()
    BaseInputModule.input
    BaseInputModule.inputOverride
    BaseInputModule.eventSystem
    UIBehaviour.Awake()
    UIBehaviour.Start()
    UIBehaviour.OnDestroy()
    UIBehaviour.IsActive()
    UnityEngine.EventSystems.UIBehaviour.OnValidate()
    UnityEngine.EventSystems.UIBehaviour.Reset()
    UIBehaviour.OnRectTransformDimensionsChange()
    UIBehaviour.OnBeforeTransformParentChanged()
    UIBehaviour.OnTransformParentChanged()
    UIBehaviour.OnDidApplyAnimationProperties()
    UIBehaviour.OnCanvasGroupChanged()
    UIBehaviour.OnCanvasHierarchyChanged()
    UIBehaviour.IsDestroyed()
    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
    UIInputModule.DoProcess()
    Remarks

    Executed once per Update call. Override for custom processing.

    See Also
    Process()

    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 pointerId. Returns null if no Interactor is associated (e.g. if it's a mouse event).

    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 interactor.

    Returns
    Type Description
    Boolean

    Returns true if the model was able to retrieved. Otherwise, returns false.

    OnDisable()

    See MonoBehavior.OnDisable.

    Declaration
    protected override void OnDisable()
    Overrides
    BaseInputModule.OnDisable()

    OnEnable()

    See MonoBehavior.OnEnable.

    Declaration
    protected override void OnEnable()
    Overrides
    BaseInputModule.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.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023