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

public class Menu : MonoBehaviour {

	public Image i;

	bool start = false;

	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		if (start) {
			FadeIn();
		}
		else {
			FadeOut();
		}
    }

	public void LoadScene(string s) {
		SceneManager.LoadScene(s);
	}

	public void Go() {
		start = true;
	}

	void FadeOut() {
		Color temp = i.color;
		temp.a = Mathf.Lerp(i.color.a, 0, Time.deltaTime * 1);
		i.color = temp;
    }

	void FadeIn() {
		Color temp = i.color;
		temp.a = Mathf.Lerp(i.color.a, 1.0f, Time.deltaTime * 1);
		i.color = temp;
		print("wow");
		if (i.color.a > .9f) {
			LoadScene("Day1");
        }
	}
}
