Input.accelerationEventCount 加速度事件数量

static var accelerationEventCount : int

Description描述

Number of acceleration measurements which occurred during last frame.

上一帧所进行的加速度测量次数。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void Update() {
		if (Input.accelerationEventCount > 0)
			print("We got new acceleration measurements");

	}
}
// Check if we got any acceleration measurements during last frame
//检查我们上一帧是否进行了加速度测量

function Update () {
	if (Input.accelerationEventCount > 0)
		print ("We got new acceleration measurements");
}
Page last updated: 2011-3-11