#pragma strict

public var text : Text;	//GameOver̃eLXg
private var coins : GameObject[];	//RCp̔z
private var flag : boolean;	//ڐG̃tO

function Start() {
	text.enabled = false;	//GameOvereLXg
	flag = false;	//flagfalse
}

function GameOver() {
	text.enabled = true;	//GameOvereLXgL
	CoinDestroy();	//CoinDestroy\bhs
	flag = true;	//flagtrueɂ
}

function CoinDestroy() {
	coins = GameObject.FindGameObjectsWithTag("Coin");	//̃RCi[
	for(var i : int = 0 ; i < coins.length ; i ++)
	Destroy(coins[i]);	//coins폜
}

//OnGUI֐Ń{^o

function OnGUI() {
	if(flag == true) {
		if(GUI.Button(Rect(100, 100, 100, 100), "Retry")) {
			Application.LoadLevel(Application.loadedLevel);	//݂Sceneēǂݍ
			flag = false;	//flagfalseɂ
		}
	}
}