death sounds, build sounds, better audio management
This commit is contained in:
parent
a7b2d1854d
commit
9f25844657
26 changed files with 313 additions and 12 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue