示例#1
0
    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();
    }
示例#2
0
 protected virtual void TakeDmg()
 {
     currentHealth -= 1;
     if (currentHealth <= 0)
     {
         Death();
     }
     else
     {
         StartCoroutine(Blink());
         PitchSound.pitchSound(gameObject, 0.4f, 1.3f);
         GetComponent <AudioSource>().Play();
     }
 }