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

public class MainMenuUI : BaseUI
{
	[SerializeField]Button continueButton = null;

	void Start()
	{
		if (continueButton != null)
		{
			continueButton.interactable = (Player.IsHaveSaveFile());
		}
		BaseUI.Show<MainMenuUI> ();
	}

	public void OnContinueGameClick()
	{
		Player.Load ();
		BaseUI.AsyncShowWithLoaderUI<StarMapUI, LoaderUI> (0, () => {
			Game.SetGameState(0);
		}, "GameScene");
	}

	public void OnStartNewGameClick()
	{
		Player.info = new Player();
		BaseUI.AsyncShowWithLoaderUI<StarMapUI, LoaderUI> (0, () => {
			Game.SetGameState(0);
		}, "GameScene");
	}

	public void OnSettingsClick()
	{
		Debug.Log ("OnSettingsClick");
	}

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