using UnityEngine;
using System.Collections;

public class WinText : MonoBehaviour {

	// Use this for initialization
    float visibility = 0.0f;
    int shownFrames = 0; 
    bool shown = false;
    Vector3 normalScale;
	void Start () {

        normalScale = transform.localScale;
	}

    public void Show()
    {
        shown = true;
        visibility = 1.0f;
    }

	// Update is called once per frame
	void Update () {
        if (shown)
        {
            shownFrames++;
            if (shownFrames > 120)
            {
                visibility *= 0.9f;
            }
        }
        else visibility = 0.0f;

        transform.localScale = normalScale * visibility;
	}
}
