aboutsummaryrefslogtreecommitdiffstats
path: root/Assets/Scripts/SoundManager.cs
blob: 128f41c3f64c28965e8f0e5db10b1f98c3c06cd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SoundManager : MonoBehaviour
{
    static AudioSource audioSrc;

    private void Start()
    {
        audioSrc = GetComponent<AudioSource>();
    }

    public static void PlaySound(string soundeffect)
    {
        audioSrc.PlayOneShot(Resources.Load<AudioClip>($"SoundEffects/{soundeffect}"));
    }
}