// Attack animation callback void Hit() { bool targetStillAlive = target && target.GetComponent <HealthSystem>().HealthAsPercentage > Mathf.Epsilon; if (targetStillAlive) { audioSource.PlayOneShot(currentWeaponConfig.GetAttackAudioClip()); target.GetComponent <HealthSystem>().TakeDamage(CalculateDamage()); } else { audioSource.PlayOneShot(currentWeaponConfig.GetSwingAudioClip()); } }