Example #1
0
 void Die()
 {
     if (!dead)
     {
         lives--;
         if (lives < 1)
         {
             //
             dead = true;
             StartCoroutine(CameraScript.Die(playerNumber));
             r.Sleep();
         }
         else
         {
             //Respawns player with maximum stamina
             r.velocity         = Vector3.zero;
             r.angularVelocity  = Vector3.zero;
             transform.position = respawnPoint;
             stamina.Drain(-stamina.maxStamina);
         }
     }
 }