#pragma strict
var maxFallDistance = -10;
function Update ()
{
if (transform.position.y <= maxFallDistance)
{
if (isRestarting == false)
{
RestartLevel();
}
}
}
function RestartLevel() {
isRestarting = true;
GetComponent.<AudioSource>().clip = GameOver;
GetComponent.<AudioSource>().Play();
yield WaitForSeconds
(GetComponent.<AudioSource>().clip.length);
Application.LoadLevel("level1");
}