docs.unity3d.com
    Show / Hide Table of Contents

    Class XRUIInputModule

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

    Inheritance
    Object
    UIInputModule
    XRUIInputModule
    Inherited Members
    UIInputModule.clickSpeed
    UIInputModule.moveDeadzone
    UIInputModule.repeatDelay
    UIInputModule.repeatRate
    UIInputModule.trackedDeviceDragThresholdMultiplier
    UIInputModule.uiCamera
    UIInputModule.Update()
    UIInputModule.Process()
    UIInputModule.SendUpdateEventToSelectedObject()
    UIInputModule.finalizeRaycastResults
    UIInputModule.pointerEnter
    UIInputModule.pointerExit
    UIInputModule.pointerDown
    UIInputModule.pointerUp
    UIInputModule.pointerClick
    UIInputModule.initializePotentialDrag
    UIInputModule.beginDrag
    UIInputModule.drag
    UIInputModule.endDrag
    UIInputModule.drop
    UIInputModule.scroll
    UIInputModule.updateSelected
    UIInputModule.move
    UIInputModule.submit
    UIInputModule.cancel
    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
    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.

    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.

    Back to top
    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