| 1 | using UnityEngine; |
| 2 | using System.Collections; |
| 3 | |
| 4 | namespace OVR |
| 5 | { |
| 6 | |
| 7 | public class TestScript : MonoBehaviour { |
| 8 | |
| 9 | [InspectorNote( "Sound Setup", "Press '1' to play testSound1 and '2' to play testSound2")] |
| 10 | |
| 11 | public SoundFXRef testSound1; |
| 12 | public SoundFXRef testSound2; |
| 13 | |
| 14 | // Use this for initialization |
| 15 | void Start () { |
| 16 | |
| 17 | } |
| 18 | |
| 19 | |
| 20 | // Update is called once per frame |
| 21 | void Update () |
| 22 | { |
| 23 | // use attached game object location |
| 24 | if ( Input.GetKeyDown( KeyCode.Alpha1 ) ) |
| 25 | { |
| 26 | testSound1.PlaySoundAt( transform.position ); |
| 27 | } |
| 28 | |
| 29 | // hard code information |
| 30 | if ( Input.GetKeyDown( KeyCode.Alpha2 ) ) { |
| 31 | testSound2.PlaySoundAt( new Vector3( 5.0f, 0.0f, 0.0f ) ); |
| 32 | } |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | } // namespace OVR |