Version: 2020.3

Input.accelerationEventCount

切换到手册
public static int accelerationEventCount ;

描述

上一帧期间进行的加速度测量的数量。

using UnityEngine;

public class Example : MonoBehaviour { // Check if we got any acceleration measurements during last frame

void Update() { if (Input.accelerationEventCount > 0) { print("We got new acceleration measurements"); } } }