death sounds, build sounds, better audio management

This commit is contained in:
Ian Woods 2026-06-30 23:12:27 -07:00
parent a7b2d1854d
commit 9f25844657
26 changed files with 313 additions and 12 deletions

View file

@ -58,7 +58,7 @@ namespace TD.Audio
}
}
public void Play(AudioClip clip, AudioCategory category, float pitch = 1f)
public void Play(AudioClip clip, AudioCategory category, float pitch = 1f, float volume = 1f)
{
if (clip == null) return;
if (!pools.TryGetValue(category, out var pool)) return;
@ -66,6 +66,7 @@ namespace TD.Audio
int idx = indices[category];
var src = pool[idx % pool.Length];
src.pitch = pitch;
src.volume = volume;
src.clip = clip;
src.Play();
indices[category] = idx + 1;