using UnityEngine;
using System.Collections;

using UnityEngine.UI;

public class DeadMenuManager : MonoBehaviour {

    private string menu = "startingMenuScene";
  
    void Awake()
    {
        this.MainMenuLoadGame();
    }

      
    public void MainMenuLoadGame() {
        LoadSavePlayerStats.Load();
        for (int i = 0; i < LoadSavePlayerStats.savedGames.Length; i++)
        {
            PlayerStats p = LoadSavePlayerStats.savedGames[i];
            if (p == null)
            {
                GameObject b = (GameObject.Find("SAVE" + (i)));
                b.GetComponent<Button>().interactable = false;
                b.transform.Find("Text").GetComponent<Text>().text = "No saved data";
            }
        }
    }

 

    public void MainMenuQuit()
    {
        Application.LoadLevel(menu);
    }
   
    public void MainMenuStart(int i) {
        LoadSavePlayerStats.isLoaded = true;
        Debug.Log("LOADING SLOT " + i);
        LoadSavePlayerStats.tmp = LoadSavePlayerStats.Load(i);
        Application.LoadLevel(LoadSavePlayerStats.tmp.scene);
    }

}
