19 lines
359 B
C#
19 lines
359 B
C#
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class SoundManager : MonoBehaviour
|
||
|
|
{
|
||
|
|
public static SoundManager instance;
|
||
|
|
public AudioSource audioSource;
|
||
|
|
public AudioClip clickSound;
|
||
|
|
|
||
|
|
void Awake()
|
||
|
|
{
|
||
|
|
instance = this;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void PlayClick()
|
||
|
|
{
|
||
|
|
if (audioSource && clickSound)
|
||
|
|
audioSource.PlayOneShot(clickSound);
|
||
|
|
}
|
||
|
|
}
|