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

public class GameOverUI : MonoBehaviour {

    public Text title;
    public Text info;
    public Text score;

    public void ShowText(bool win, int achievedScore, int maxScore, int aliensKilled) {
        string infoText;

        if (win) {
            infoText = "You repaired your ship!";
            title.text = "You won!...";
        }
        else {
            infoText = "You died!";
            title.text = "You lost!";
        }
        
        if (aliensKilled < 5)
            infoText += " You killed only " + aliensKilled + " aliens??";
        else if (aliensKilled < 20)
            infoText += " Solid " + aliensKilled + " aliens killed...";
        else
            infoText += " Very nice! " + aliensKilled + " aliens killed.";


        info.text = infoText;
        score.text = achievedScore + "/" + maxScore + " Repaired modules";
    }

    public void PlayAgain() {
        Debug.Log("Again");
        SceneManager.LoadScene("Game");
    }

    public void LoadMainMenu() {
        Debug.Log("MM");
        SceneManager.LoadScene("MainMenu");
    }
}
