Table of Contents

Class UnityMapInputSource

Namespace
LansMap.Interaction

The shipped input source: Unity's own mouse, keyboard and touch.

public sealed class UnityMapInputSource : IMapInputSource
Inheritance
object
UnityMapInputSource
Implements

Fields

Instance

The shared instance; this type holds no per-map state.

public static readonly UnityMapInputSource Instance

Field Value

UnityMapInputSource

Properties

PointerPosition

Pointer position in screen pixels, origin top left, Y increasing downward.

public ScreenPoint PointerPosition { get; }

Property Value

ScreenPoint

ScrollDelta

Scroll wheel movement this frame, in notches.

public float ScrollDelta { get; }

Property Value

float

TouchCount

Touches down this frame.

public int TouchCount { get; }

Property Value

int

TouchSupported

Whether this device can report touches at all.

public bool TouchSupported { get; }

Property Value

bool

Methods

GetKey(KeyCode)

Whether a key is held.

public bool GetKey(KeyCode key)

Parameters

key KeyCode

Key to test.

Returns

bool

True while the key is down.

GetKeyDown(KeyCode)

Whether a key went down this frame.

public bool GetKeyDown(KeyCode key)

Parameters

key KeyCode

Key to test.

Returns

bool

True on the press frame only.

GetMouseButton(int)

Whether a mouse button is held.

public bool GetMouseButton(int button)

Parameters

button int

0 left, 1 right, 2 middle.

Returns

bool

True while the button is down.

GetMouseButtonDown(int)

Whether a mouse button went down this frame.

public bool GetMouseButtonDown(int button)

Parameters

button int

0 left, 1 right, 2 middle.

Returns

bool

True on the press frame only.

GetMouseButtonUp(int)

Whether a mouse button came up this frame.

public bool GetMouseButtonUp(int button)

Parameters

button int

0 left, 1 right, 2 middle.

Returns

bool

True on the release frame only.

GetTouch(int)

One touch, by index.

public MapTouch GetTouch(int index)

Parameters

index int

0 to TouchCount - 1.

Returns

MapTouch

Position (screen px, top-left origin), phase, and the stable per-finger id. Track a finger across frames by that id, not by this index.