スクリーンに指をタッチしたときの状態を扱う構造体
デバイスはタッチスクリーン上の複数のタッチしたデータをトラッキングすることができます。その中には phase (例: 指の状態がタッチしたか、離したか、または動いたか)や位置情報、1 つの指でタッチしたか複数の指でタッチしたかどうかを判断することができるデータも含まれています。その上、フレームのアップデート間によるタッチの連続性はデバイスによって検出することが可能です。なので一貫した ID を取得することができるので特定の指の移動を把握することができます。
Touch 構造体は Unity によって 1 つのタッチ情報として保存され Input.GetTouch 関数によって取得することができます。新たに GetTouch を呼び出すと毎フレームでデバイスから最新のタッチ情報を取得することができます。また、fingerId プロパティーはフレーム間で同じ指かどうかを判断することに使用できます。
関連項目: Input.GetTouch、TouchPhase 構造体
altitudeAngle | 0 ラジアンはスタイラスが表面に対して並行であることを示し、PI/2 は垂直であることを示します。 |
azimuthAngle | 0 ラジアンは、スタイラスがデバイスの x 軸 に沿って方向を指していることを示します。 |
deltaPosition | 1 つ前にタッチしたところからの位置の変動値を返す |
deltaTime | タッチ情報が最後に記録された時から経過した時間 |
fingerId | タッチのユニークなインデックス |
maximumPossiblePressure | プラットフォームで可能な圧力の最大値。Input.touchPressureSupported が false を返す場合、このプロパティーの値は常に 1.0f となります。 |
phase | タッチのフェーズを設定する |
position | タッチしたピクセル座標 |
pressure | 現在、タッチに適用されている圧力。1.0f は平均的なタッチの圧力と考えられています。Input.touchPressureSupported が false を返す場合は、このプロパティーの値は常に 1.0f となります。 |
radius | タッチの半径の推定値。最大タッチサイズはこれに radiusVariance を加え、最小タッチサイズはこれから radiusVariance を差し引いて求めます。 |
radiusVariance | This value determines the accuracy of the touch radius. Add this value to the radius to get the maximum touch size, subtract it to get the minimum touch size. |
rawPosition | タッチしたピクセル座標、初期位置 |
tapCount | タップした数を返す |
type | タッチが Direct、Indirect (または Remote)、Stylus 型のいずれであるかを示します。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.