Add gameover screen

This commit is contained in:
Soulaha Balde 2022-05-15 16:50:07 -04:00
parent 21e510045f
commit b40000c70b
8 changed files with 4545 additions and 1085 deletions

BIN
Assets/Art/cursor.png.meta (Stored with Git LFS)

Binary file not shown.

View File

@ -509,7 +509,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0} m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1 m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1 m_Maskable: 1
m_OnCullStateChanged: m_OnCullStateChanged:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 506bd4d1f6d245b438eebe3555cf0421 guid: 3c73e3e9bc58d3444bb4e02645afdbfa
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -66,6 +66,7 @@ public class GameManager : MonoBehaviour
// Show Game Over Message // Show Game Over Message
Debug.Log("Game Over: Dimension " + dimensionID + " has been destroyed"); Debug.Log("Game Over: Dimension " + dimensionID + " has been destroyed");
uiController.TriggerGameOver();
// Show Options (Return to Menu / Retry) // Show Options (Return to Menu / Retry)
state = GameState.Loss; state = GameState.Loss;

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using TMPro; using TMPro;
using UnityEngine.SceneManagement;
public class UIController : MonoBehaviour public class UIController : MonoBehaviour
{ {
@ -12,6 +13,7 @@ public class UIController : MonoBehaviour
[SerializeField] private HealthBar[] verticalHealthBars; [SerializeField] private HealthBar[] verticalHealthBars;
[SerializeField] private Color[] hpBarColorPerDimension; [SerializeField] private Color[] hpBarColorPerDimension;
[SerializeField] private Transform gameoverPnl;
public void UpdatePointsText(float points) public void UpdatePointsText(float points)
{ {
@ -41,4 +43,27 @@ public class UIController : MonoBehaviour
mainHealthBar.SetFillingAmount(hpFillingAmount); mainHealthBar.SetFillingAmount(hpFillingAmount);
} }
} }
public void TriggerGameOver(){
gameoverPnl.gameObject.SetActive(!gameoverPnl.gameObject.activeSelf);
}
public void LoadMenu()
{
Time.timeScale = 1f;
SoundManager.Instance.SwitchMusicLayer(-1);
SceneManager.LoadScene(0);
}
public void RestartGame()
{
Time.timeScale = 1f;
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
public void QuitGame()
{
Debug.Log("QuitGame");
Application.Quit();
}
} }

View File

@ -18,7 +18,7 @@ PhysicsManager:
m_ClothInterCollisionDistance: 0.1 m_ClothInterCollisionDistance: 0.1
m_ClothInterCollisionStiffness: 0.2 m_ClothInterCollisionStiffness: 0.2
m_ContactsGeneration: 1 m_ContactsGeneration: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffbfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffbffffffffffcffff7ffdffff7ffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1 m_AutoSimulation: 1
m_AutoSyncTransforms: 0 m_AutoSyncTransforms: 0
m_ReuseCollisionCallbacks: 1 m_ReuseCollisionCallbacks: 1