Advertisement
pelemexa

Untitled

Jul 27th, 2021
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement