UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"sound on button click"
public class Beep : MonoBehaviour { private AudioSource audioSource; // Start is called before the first frame update private void Start() { audioSource = GetComponent<AudioSource>(); } public void PlayBeep() { audioSource.Play(); } public void DontPlayBeep() { audioSource.Stop(); } }