using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class MainMenuManager : MonoBehaviour {

	public string startingLevel;

	public GameObject startButton;
	public GameObject instructionButton;
	public GameObject quitButton;
	public GameObject highscore;

	public GameObject howToPlayCanvas;
	public GameObject introCanvas;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		highscore.GetComponent<Text>().text = (
			"highscores:\n" +
			"Level 1: " + PlayerPrefs.GetInt("Level 1highscore",0) + "\n" +
			"Level 2: " + PlayerPrefs.GetInt("Level 2highscore",0) + "\n" +
			"Level 3: " + PlayerPrefs.GetInt("Level 3highscore",0) + "\n" +
			"Level 4: " + PlayerPrefs.GetInt("Level 4highscore",0) + "\n"
		);
	}
		
	public void showMenu(){
		startButton.SetActive (true);
		instructionButton.SetActive (true);
		quitButton.SetActive (true);
		highscore.SetActive (true);
	}

	public void startGameIntro(){
		introCanvas.SetActive(true);
	}

	public void showInstruction(){
		howToPlayCanvas.SetActive (true);
	}

	public void hideInstruction(){
		howToPlayCanvas.SetActive(false);
	}

	public void startLevel(){
		SceneManager.LoadScene (startingLevel);
	}

	public void quit(){
		Application.Quit ();
	}
}
