用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:touch:touch

Touch 触摸

struct in UnityEngine

Description 描述

Structure describing the status of a finger touching the screen.

描述手指触摸屏幕的状态的结构。

Devices can track a number of different pieces of data about a touch on a touchscreen, including its phase (ie, whether it has just started, ended or moved), its position and whether the touch was a single contact or several taps. Furthermore, the continuity of a touch between frame updates can be detected by the device, so a consistent ID number can be reported across frames and used to determine how a particular finger is moving.

设备可以跟踪触摸屏上的多个触摸,包括它的相位(例如,是否开始、结束或移动)、它的位置和是否有单个或多个触摸点。此外,触摸之间的帧更新连续性能由设备检测,因此,一致的ID能跨帧报告,并用了确定指定手指移动了多少。

The Touch struct is used by Unity to store data relating to a single touch instance and is returned by the Input.GetTouch function. Fresh calls to GetTouch will be required on each frame update to obtain the latest touch information from the device but the fingerId property can be used to identify the same touch between frames.

触摸结构用于通过Unity存储与单个触摸实例相关数据并由Input.GetTouch函数返回。新调用GetTouch需要在每帧更新从设备获得最新的触摸信息,但fingerId属性能用于识别帧之间的相同的触摸。

See Also: Input.GetTouch, TouchPhase enum.

Variables 变量

deltaPositionThe position delta since last change.
自最后改变的位置增量。
deltaTimeAmount of time that has passed since the last recorded change in Touch values.
触摸值自上次改变已经过去的时间量。
fingerIdThe unique index for the touch.
用于触摸的唯一索引。
phaseDescribes the phase of the touch.
该触摸相位的描述。
positionThe position of the touch in pixel coordinates.
像素坐标系,触摸的位置。
tapCountNumber of taps.
触摸轻触的次数。
script/unityengine/classes/touch/touch.txt · 最后更改: 2016/08/02 05:32 (外部编辑)