pelemexa

Untitled

Jul 27th, 2021
29
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class SoundController : MonoBehaviour
  6. {
  7. private AudioSource _audio;
  8.  
  9. public AudioClip ClickSound;
  10.  
  11. private void Start()
  12. {
  13. _audio = GetComponent<AudioSource>();
  14. }
  15.  
  16. public void OnClickButton()
  17. {
  18. _audio.PlayOneShot(ClickSound);
  19. }
  20. }
RAW Paste Data