Version: 5.6

Input.GetAccelerationEvent

매뉴얼로 전환
public static AccelerationEvent GetAccelerationEvent (int index);

설명

Returns specific acceleration measurement which occurred during last frame. (Does not allocate temporary variables).

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Update() { Vector3 acceleration = Vector3.zero; int i = 0; while (i < Input.accelerationEventCount) { AccelerationEvent accEvent = Input.GetAccelerationEvent(i); acceleration += accEvent.acceleration * accEvent.deltaTime; ++i; } print(acceleration); } }