#pragma strict
var score: SpaceshipController;
var MenuDesign: GUISkin;
static var highestScore: int;

function Start () {
	//score = GameObject.FindGameObjectWithTag("Player").GetComponent(SpaceshipController);
}

function Update () {

}
function OnGUI()
{
	GUI.skin = MenuDesign;
	if (Application.loadedLevelName == "Menu"){
		GUI.Label(Rect(455,250,100,200), "Highest Score:" + highestScore);
		if (GUI.Button(Rect(400,300,200,20), "Play!"))
		{
			Application.LoadLevel("LevelOne");
		}
	}
	
	if (Application.loadedLevelName == "GameOverScreen")
	{
		GUI.Label(Rect(10,10,100,200), "Game over!");
		if (score.score > highestScore)
		{
			highestScore = score.score;
		}
		
		GUI.Label(Rect(10,30,100,200), "Score: " + score.score);		
		if (GUI.Button(Rect(10,60,150,150), "Go to Main Menu"))
		{
			score.score = 0;
			Application.LoadLevel("Menu");
		}
	}
	if (Application.loadedLevelName == "GamePassed")
	{
		GUI.Label(Rect(10,10,100,200), "Well Played!");
		if (score.score > highestScore)
		{
			highestScore = score.score;
		}
				
		GUI.Label(Rect(10,30,100,200), "Score: " + score.score);		
		if (GUI.Button(Rect(10,60,150,150), "Go to Main Menu"))
		{
			score.score = 0;
			Application.LoadLevel("Menu");
		}
	}
}