Beispiel #1
0
 void PlayerDeath()
 {
     if (!dead)
     {
         timerui.UpdateDeaths(currentLevel);
         dead           = true;
         rb.constraints = RigidbodyConstraints2D.FreezeAll;
         an.Play("Hurt");
         AudioSource.PlayClipAtPoint(death, transform.position);
         Invoke("PlayerDeath", .6f);
     }
     else
     {
         an.Play("Idle");
         rb.constraints     = RigidbodyConstraints2D.None;
         transform.position = spawnPoint;
         dead = false;
     }
 }