using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AudioHandler : MonoBehaviour {
    public List<AudioSource> audioSources;

    public void Play(string source)
    {
        for (int i = 0; i < audioSources.Count; i++)
        {
            if (audioSources[i].gameObject.name == source)
                audioSources[i].Play();
        }
    }

    public void Stop(string source)
    {
        for (int i = 0; i < audioSources.Count; i++)
        {
            if (audioSources[i].gameObject.name == source)
                audioSources[i].Stop();
        }
    }
}
