-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEndScreenUI.cs
More file actions
39 lines (33 loc) · 1.1 KB
/
EndScreenUI.cs
File metadata and controls
39 lines (33 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class EndScreenUI : MonoBehaviour
{
public TextMeshProUGUI headerText;
public TextMeshProUGUI bodyText;
public void SetEndScreen (bool didWin, int roundsSurvived)
{
if(didWin == true){
headerText.text = $"Mission Success! Congratulations!";
headerText.color = Color.green;
bodyText.text = $"Mission Completed in {roundsSurvived} waves";
bodyText.color = Color.yellow;
}else {
headerText.text = $"Mission failed! Polluta has taken over!";
headerText.color = Color.red;
bodyText.text = $"You survived {roundsSurvived} waves";
bodyText.color = Color.yellow;
}
}
public void OnPlayAgainButton ()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
public void OnQuitButton ()
{
Application.Quit();
}
}