Device physical orientation as reported by OS. (Read Only)
#pragma strict var audio: AudioSource; function Start() { audio = GetComponent.<AudioSource>(); } function Update() { if (Input.deviceOrientation == DeviceOrientation.FaceDown) audio.Play(); }
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { AudioSource audio;
void Start() { audio = GetComponent<AudioSource>(); }
void Update() { if (Input.deviceOrientation == DeviceOrientation.FaceDown) audio.Play(); } }