Version: 2022.3

Input.touchCount

切换到手册
public static int touchCount ;

描述

触摸次数。保证在整个帧期间不会更改。(只读)

using UnityEngine;

public class Example : MonoBehaviour { void Update() { if (Input.touchCount > 0) { print(Input.touchCount); } } }