using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class SoundManager : MonoBehaviour | |
{ | |
public static SoundManager Instance { get; set; } | |
public AudioSource dropItemSound; | |
public AudioSource grassWalkSound; | |
private void Awake() | |
{ | |
if (Instance != null && Instance != this) | |
{ | |
Destroy(gameObject); | |
} | |
else | |
{ | |
Instance = this; | |
} | |
} | |
public void PlaySound(AudioSource sound) | |
{ | |
if (sound.isPlaying == false) | |
{ | |
sound.Play(); | |
} | |
} | |
} | |