docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class EnhancedSpatialPointerSupport

    This is a complimentary API to EnhancedTouchSupport to offer a route to static methods and polling methods related to PolySpatialPointerDevice

    Inheritance
    object
    EnhancedSpatialPointerSupport
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.PolySpatial.InputDevices
    Assembly: Unity.PolySpatial.Core.dll
    Syntax
    public static class EnhancedSpatialPointerSupport

    Methods

    AddInputs(SpatialPointerDevice)

    Registers inputs from the given SpatialPointerDevice for history tracking and query.

    Declaration
    public static void AddInputs(SpatialPointerDevice pointerDevice)
    Parameters
    Type Name Description
    SpatialPointerDevice pointerDevice

    The SpatialPointerDevice whose input controls will be recorded. Each input is tracked with a history depth of one, and is associated by touch ID starting from FirstTouchID.

    Remarks

    This starts recording state changes for each input on the device so they can be queried via TryGetPointerState(Touch, out SpatialPointerState) and GetPointerState(Touch).

    GetPointerState(Touch)

    Gets the most recent SpatialPointerState for the specified Enhanced Touch.

    Declaration
    public static SpatialPointerState GetPointerState(Touch touch)
    Parameters
    Type Name Description
    Touch touch

    The EnhancedTouch Touch whose pointer state should be read. The touchId is used to look up the state.

    Returns
    Type Description
    SpatialPointerState

    The latest recorded SpatialPointerState for the touch, with the phase adjusted to reflect EnhancedTouch transitions; returns default if no state is available.

    TryGetPointerState(Touch, out SpatialPointerState)

    Attempts to retrieve the most recent SpatialPointerState for the specified Enhanced Touch.

    Declaration
    public static bool TryGetPointerState(Touch touch, out SpatialPointerState state)
    Parameters
    Type Name Description
    Touch touch

    The EnhancedTouch Touch whose pointer state should be queried. The touchId is used to look up the state.

    SpatialPointerState state

    When this method returns true, contains the latest recorded SpatialPointerState for the touch. The phase is adjusted to mirror EnhancedTouch behavior (e.g., Began may be transitioned to Stationary).

    Returns
    Type Description
    bool

    True if a recorded state exists for the given touch; otherwise, false.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)