Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Unity.Engine;
- using System.Collections;
- public class Sounds : MonoBehaviour
- {
- public AudioClip din;
- void Start()
- {
- audio = GetComponent<AudioSource>();
- }
- void Update()
- {
- if (Input.GetKeyDown(KeyCode.Space)) //здесь задаете любую кнопку
- audio.PlayOneShot(din);
- }
- }
Add Comment
Please, Sign In to add comment