Guest User

Untitled

a guest
Dec 6th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. using Unity.Engine;
  2. using System.Collections;
  3.  
  4. public class Sounds : MonoBehaviour
  5. {
  6. public AudioClip din;
  7.  
  8. void Start()
  9. {
  10. audio = GetComponent<AudioSource>();
  11. }
  12.  
  13. void Update()
  14. {
  15. if (Input.GetKeyDown(KeyCode.Space)) //здесь задаете любую кнопку
  16. audio.PlayOneShot(din);
  17. }
  18. }
Add Comment
Please, Sign In to add comment