Version: 2017.3
public bool enabled ;

描述

设置或检索该陀螺仪的启用状态。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public bool enableTilt; void OnGUI() { if (Input.gyro.enabled) GUILayout.Toggle(enableTilt, "Enable tilt control"); } }