Verlieren und Gewinnen Screen
This commit is contained in:
@ -153,15 +153,27 @@ public partial class GameManager : MonoBehaviourSingleton<GameManager>
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private bool _won;
|
||||
|
||||
public bool Won => _won;
|
||||
|
||||
[SerializeField]
|
||||
private bool _lost;
|
||||
|
||||
public bool Lost => _lost;
|
||||
|
||||
private void EndGame(EndGameCondition endGameCondition)
|
||||
{
|
||||
if (endGameCondition.IsWin())
|
||||
{
|
||||
Debug.Log("You won!");
|
||||
_won = true;
|
||||
}
|
||||
else if (endGameCondition.IsLose())
|
||||
{
|
||||
Debug.Log("You lost!");
|
||||
_lost = true;
|
||||
}
|
||||
|
||||
Debug.Log(endGameCondition.GetEndGameMessage());
|
||||
|
||||
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using Interaction;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine.UI;
|
||||
|
||||
@ -37,12 +38,18 @@ public class UiController : MonoBehaviour
|
||||
[SerializeField] private TextMeshProUGUI _predictedEndText;
|
||||
|
||||
[SerializeField] private Gradient _deadlineTextColors;
|
||||
|
||||
public GameObject WinScreen;
|
||||
public GameObject LoseScreen;
|
||||
|
||||
void Update()
|
||||
{
|
||||
UpdateActionDisplay();
|
||||
UpdateProgressBar();
|
||||
UpdateDeadlineDateStuffTexts();
|
||||
|
||||
WinScreen.SetActive(GameManager.Instance.Won);
|
||||
LoseScreen.SetActive(GameManager.Instance.Lost);
|
||||
}
|
||||
|
||||
private void UpdateProgressBar()
|
||||
@ -97,4 +104,16 @@ public class UiController : MonoBehaviour
|
||||
//_prevActionButton.interactable = _pickupper.CanSelectPrevious;
|
||||
//_nextActionButton.interactable = _pickupper.CanSelectNext;
|
||||
}
|
||||
|
||||
public void Replay()
|
||||
{
|
||||
string currentSceneName = SceneManager.GetActiveScene().name;
|
||||
SceneManager.LoadScene(currentSceneName);
|
||||
}
|
||||
|
||||
public void Exit()
|
||||
{
|
||||
UnityEditor.EditorApplication.isPlaying = false;
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user