示例#1
0
 void TakeDamage()
 {
     if (invulnerable)
     {
         return;
     }
     lives--;
     if (lives <= 0)
     {
         SceneManager.LoadScene(SceneManager.GetActiveScene().name);
     }
     HeartsUI.RemoveHeart();
     StartCoroutine(Invulnerability(1));
 }
示例#2
0
 public void TakeDamage()
 {
     if (invulnerable)
     {
         return;
     }
     audioSource.PlayOneShot(hitsound);
     lives--;
     HeartsUI.RemoveHeart();
     if (lives <= 0)
     {
         SceneManager.LoadScene(SceneManager.GetActiveScene().name);
     }
     StartCoroutine(Invulnerability(1));
 }