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

@ -17,12 +17,7 @@ namespace TD.Combat
[RequireComponent(typeof(TowerCombat))]
public class TeslaTowerFireSound : MonoBehaviour
{
[Tooltip("Sound played each time the coil discharges.")]
[SerializeField] private AudioClip fireClip;
[Tooltip("Pitch is randomized within this range each shot to avoid a mechanical loop.")]
[SerializeField] private float minPitch = 0.93f;
[SerializeField] private float maxPitch = 1.07f;
[SerializeField] private SoundConfig fireSound;
private TowerCombat combat;
@ -43,7 +38,7 @@ namespace TD.Combat
private void HandleAreaFired(Vector3[] positions)
{
AudioManager.Instance?.Play(fireClip, AudioCategory.TowerFire, Random.Range(minPitch, maxPitch));
AudioManager.Instance?.Play(fireSound.clip, AudioCategory.TowerFire, fireSound.RandomPitch(), fireSound.volume);
}
}
}