Class UnityMapInputSource
- Namespace
- LansMap.Interaction
The shipped input source: Unity's own mouse, keyboard and touch.
public sealed class UnityMapInputSource : IMapInputSource
- Inheritance
-
objectUnityMapInputSource
- Implements
Fields
Instance
The shared instance; this type holds no per-map state.
public static readonly UnityMapInputSource Instance
Field Value
Properties
PointerPosition
Pointer position in screen pixels, origin top left, Y increasing downward.
public ScreenPoint PointerPosition { get; }
Property Value
ScrollDelta
Scroll wheel movement this frame, in notches.
public float ScrollDelta { get; }
Property Value
TouchCount
Touches down this frame.
public int TouchCount { get; }
Property Value
TouchSupported
Whether this device can report touches at all.
public bool TouchSupported { get; }
Property Value
Methods
GetKey(KeyCode)
Whether a key is held.
public bool GetKey(KeyCode key)
Parameters
keyKeyCodeKey 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
keyKeyCodeKey to test.
Returns
- bool
True on the press frame only.
GetMouseButton(int)
Whether a mouse button is held.
public bool GetMouseButton(int button)
Parameters
buttonint0 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
buttonint0 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
buttonint0 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
indexint0 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.