void OnCollisionStay2D(Collision2D other)
 {
     if (other.gameObject.CompareTag("Player") && !enemyDying) //kill player + lose life if they touch enemy
     {
         if (playerScript.livesLeft != 0)
         {
             playerScript.Restart();
             playerScript.livesLeft -= 1;
             lives.GetChild(Mathf.RoundToInt(playerScript.livesLeft)).gameObject.SetActive(false);
         }
     }
 }
Пример #2
0
 public void LoadLevel()
 {
     _PlayerScript.Restart();
 }