Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
717 B

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