Guest User

Untitled

a guest
Apr 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. var beep : AudioClip;
  2.  
  3. function exitGame(){
  4. if (Input.GetKey ("Esc")){
  5. OpenLevel("Menu");
  6. }
  7. }
  8.  
  9. function OpenLevel(level : String){
  10. audio.PlayOneShot(beep);
  11. yield new WaitForSeconds(0.35);
  12. Application.LoadLevel(level);
  13. }
  14.  
  15. @script RequireComponent(AudioSource)
Add Comment
Please, Sign In to add comment