class PlatformAgnosticInput (Niantic.ARDK.Utilities.PlatformAgnosticInput)

Overview

Cross-platform class that unifies Unity’s mouse and Touch input APIs. More…

class PlatformAgnosticInput {
public:
    // classes

    class MouseEventBuffer;

    // properties

    int? touchCount;

    // methods

    static Touch GetTouch(int index);
    static bool IsTouchOverUIObject(this Touch touch);
};

Detailed Documentation

Cross-platform class that unifies Unity’s mouse and Touch input APIs.

Note

When run in the Unity Editor, the class will convert mouse input changes into touch input. When run natively on a mobile device, the class will simply surface Input.GetTouch, Input.touchCount, etc.

Properties

int? touchCount

The number of touches.

Methods

static Touch GetTouch(int index)

Call to obtain the status of a finger touching the screen.

Parameters:

index

The touch input on the device screen. If touchCount is greater than zero, this parameter sets which screen touch to check. Use zero to obtain the first screen touch.

Returns:

Touch details as a struct.

static bool IsTouchOverUIObject(this Touch touch)

Determines if a specific touch is over any UI raycast targets. Useful for discounting screen touches before processing them as gestures.