Basic game completed
This commit is contained in:
27
3D FPS/Assets/Scripts/GameOverScreen.cs
Normal file
27
3D FPS/Assets/Scripts/GameOverScreen.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEditor.SearchService;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
||||
public class GameOverScreen : MonoBehaviour
|
||||
{
|
||||
public TextMeshProUGUI scoreText;
|
||||
public void TriggerScreen(int score = 0)
|
||||
{
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
scoreText.text = "SCORE: " + score.ToString();
|
||||
gameObject.SetActive(true);
|
||||
|
||||
Time.timeScale = 0;
|
||||
}
|
||||
|
||||
public void RestartButton()
|
||||
{
|
||||
Time.timeScale = 1;
|
||||
SceneManager.LoadScene("SampleScene");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user