using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;

public class UI_GameOver : TM_UI_Base 
{
    public TextMeshProUGUI txtScore;
    public TextMeshProUGUI txtInformation;

    private GameManager theGame;

	// Use this for initialization
	void Start ()
	{
	    theGame = GameManager.GetGame();
	}
	
	// Update is called once per frame
	void Update () 
    {
        if (bFirstUpdate)
        {
            bFirstUpdate = false;
            TurnOff();
        }

        txtInformation.text = "Your planet was:\n\n<size=48>" + theGame.GetSizeOfPlanetString() +"</size>\n\nFinal Score";

        txtScore.text = theGame.GetScore().ToString();

        if (theGame.thePlayer.myRewiredPlayer.GetButton("FireWeapon"))
        {
            OnClick_Submit();
        }
		
	}

    public void OnClick_Submit()
    {
        theGame.EndGameOverState();
    }
}
