public void PlaySound(AudioClip clip, bool pitchSound = true, float volume = 0.13f) { audioSource.clip = clip; if (pitchSound) { PitchSound.pitchSound(gameObject, 0.8f, 1.6f); } audioSource.volume = volume; audioSource.Play(); }
protected virtual void TakeDmg() { currentHealth -= 1; if (currentHealth <= 0) { Death(); } else { StartCoroutine(Blink()); PitchSound.pitchSound(gameObject, 0.4f, 1.3f); GetComponent <AudioSource>().Play(); } }