using UnityEngine;
using System.Collections;

public class Timer : MonoBehaviour
{
    public GameObject victoryScreen;

    float currentTime;
    public float winTime;
    bool Won;

	// Use this for initialization
	void Start ()
    {
        Won = false;
        currentTime = 0;
	}
	
	// Update is called once per frame
	void Update ()
    {
        if (!Won)
            currentTime += Time.deltaTime;
	}

    public void Win()
    {
        if (!Won)
        {
            winTime = currentTime;
            Won = true;
            victoryScreen.SetActive(true);
        }
    }

    public bool GetWin()
    {
        return Won;
    }
}
