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
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue