using System.Collections; using System.Collections.Generic; using UnityEngine; public class AudioTest : MonoBehaviour { // Start is called before the first frame update AudioSource m_AudioSource; void Start() { m_AudioSource = GetComponent(); } // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.M)) { Debug.Log("Sound"); m_AudioSource.Play(); } } }