Firstborn/Library/PackageCache/com.unity.inputsystem@1.5.1/Documentation~/Pointers.md
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

2.7 KiB

Pointers

Pointer Devices are defined as InputDevices that track positions on a 2D surface. The Input System supports three types of pointers:

Controls

Each of these types implements a common set of Controls. For a more detailed descriptions of these Controls, refer to their scripting reference.

Control Type Description
position Vector2Control The current pointer coordinates in window space.
delta Vector2Control Provides motion delta in pixels accumulated (summed) over the duration of the current frame/update. Resets to (0,0) each frame.

Note that the resolution of deltas depends on the specific hardware and/or platform.
press ButtonControl Whether the pointer or its primary button is pressed down.
pressure AxisControl The pressure applied with the pointer while in contact with the pointer surface. This value is normalized. This is only relevant for pressure-sensitive devices, such as tablets and some touch screens.
radius Vector2Control The size of the area where the finger touches the surface. This is only relevant for touch input.

Window space

The coordinates within Player code are in the coordinate space of the Player window.

Within Editor code, the coordinates are in the coordinate space of the current EditorWindow. If you query Pointer.current.position in UnityEditor.EditorWindow.OnGUI, for example, the returned 2D vector will be in the coordinate space of your local GUI (same as UnityEngine.Event.mousePosition).