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

public class MenuPlayButton : MonoBehaviour {

	public GameObject[] MenuOptions = new GameObject[3];
	public Sprite tCredits = null;
	public Sprite tMenuScreen = null;
	public GameObject CreditsObject = null;

	[SerializeField]
	private AudioClip MenuSoundtrack = null;

	// Use this for initialization
	void Start () {
		Camera.main.GetComponent<AudioController> ().PlayMusic (MenuSoundtrack);
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	public void ChangeScenePlay()
	{
		Application.LoadLevel (1);
	}

	public void ChangeSceneCredits()
	{
		//Change texture of credits
		GetComponentInParent<Image> ().sprite = tCredits;
		foreach (GameObject g in MenuOptions)
			g.SetActive (false);
		CreditsObject.SetActive (true);
	}

	public void ChangeSceneCredToMenu()
	{
		GetComponentInParent<Image> ().sprite = tMenuScreen;
		foreach (GameObject g in MenuOptions)
			g.SetActive (true);
		CreditsObject.SetActive (false);
	}
}
