Device physical orientation as reported by OS. (Read Only)
#pragma strict var audioSource: AudioSource; function Start() { audioSource = GetComponent.<AudioSource>(); } function Update() { if (Input.deviceOrientation == DeviceOrientation.FaceDown) audioSource.Play(); }
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { AudioSource audioSource;
void Start() { audioSource = GetComponent<AudioSource>(); }
void Update() { if (Input.deviceOrientation == DeviceOrientation.FaceDown) audioSource.Play(); } }
Did you find this page useful? Please give it a rating: