Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

Touch

struct in UnityEngine

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual

Descripción

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.

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.

See Also: Input.GetTouch, TouchPhase enum.

Variables

altitudeAngleValue of 0 radians indicates that the stylus is parallel to the surface, pi/2 indicates that it is perpendicular.
azimuthAngleValue of 0 radians indicates that the stylus is pointed along the x-axis of the device.
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.
maximumPossiblePressureThe maximum possible pressure value for a platform. If Input.touchPressureSupported returns false, the value of this property will always be 1.0f.
phaseDescribes the phase of the touch.
positionThe position of the touch in pixel coordinates.
pressureThe current amount of pressure being applied to a touch. 1.0f is considered to be the pressure of an average touch. If Input.touchPressureSupported returns false, the value of this property will always be 1.0f.
radiusAn estimated value of the radius of a touch. Add radiusVariance to get the maximum touch size, subtract it to get the minimum touch size.
radiusVarianceThe amount that the radius varies by for a touch.
rawPositionThe raw position used for the touch.
tapCountNumber of taps.
typeA value that indicates whether a touch was of Direct, Indirect (or remote), or Stylus type.