completed sounds

This commit is contained in:
MrTorex committed 2026-02-04 19:02:55 +03:00
1 parent 3938d93241
commit be3defc280
12 files changed
+1084 -22

No files matched your search

@@ -27,6 +27,7 @@ namespace Code.Gameplay.Player
public float nextAttackTime => _lastAttackTime + _attackCooldown;
private AudioClip _attackClip;
private AudioClip _damageClip;
public event Action<int> OnHealthChanged;
public event Action OnDied;
@@ -39,6 +40,7 @@ namespace Code.Gameplay.Player
private void Start()
{
_attackClip = Resources.Load<AudioClip>("Audio/SFX/AttackSFX");
_damageClip = Resources.Load<AudioClip>("Audio/SFX/DamageSFX");
_currentHealth = _maxHealth;
OnHealthChanged?.Invoke(_currentHealth);
}
@@ -59,6 +61,7 @@ namespace Code.Gameplay.Player
_currentHealth -= _damageFromEnemy;
OnHealthChanged?.Invoke(_currentHealth);
OnTookDamage?.Invoke();
audioSource.PlayOneShot(_damageClip);
if (_currentHealth <= 0)
{