using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Menu : MonoBehaviour
{
    public int levelOne;
    public int credits;

    public Font[] scoreWriteOut;

    void Start()
    {
        if (scoreWriteOut.Length > 0)
        {
            scoreWriteOut[0].WriteNumber(PlayerPrefs.GetInt("Time Score").ToString());
            scoreWriteOut[1].WriteNumber(PlayerPrefs.GetInt("Steal Score").ToString());
            scoreWriteOut[2].WriteNumber(PlayerPrefs.GetInt("Final Score").ToString());
        }
    }

    void Update()
    {
        if (Application.loadedLevel == 5 && Input.anyKeyDown)
            Application.LoadLevel(6);
        else if (Application.loadedLevel == 6 && Input.anyKeyDown)
            StartGame();

    }

    public void ControlsScreen()
    {
        Application.LoadLevel(5);
    }

    public void StartGame()
    {
        Application.LoadLevel(levelOne);
    }

    public void RestartGame()
    {
        Application.LoadLevel(0);
	}

    public void RestartLevel()
    {
        Application.LoadLevel(Application.loadedLevel);
    }

    public void Credits()
    {
        Application.LoadLevel(credits);
    }

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