namespace GIADBase
{
class SoundHandler
{
public float GlobalVolume = 0.5f;
protected Dictionary SoundEffects = new Dictionary();
public bool AddSoundEffect(string path, SoundEffect soundEffect)
{
if (!SoundEffects.Keys.Contains(path))
{
SoundEffects.Add(path, soundEffect);
}
else { return false; }
return true;
}
public int PlaySoundEffect(string path, float Volume, float Pitch, float Pan)
{
SoundEffects[path].Play(Volume * GlobalVolume, Pitch, Pan);
return 0;
}
//TODO: add music playing here
}
}
No comments available.
Add new comment