From 61930cf21d3eb145df11ea2b719ae7be66c56d24 Mon Sep 17 00:00:00 2001
From: miepzerino <o.skotnik@gmail.com>
Date: Tue, 19 Dec 2023 02:38:48 +0000
Subject: [PATCH] Added save/load game

---
 Assets/Scripts/Managers/UIManager.cs |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Assets/Scripts/Managers/UIManager.cs b/Assets/Scripts/Managers/UIManager.cs
index aaaed31..d710deb 100644
--- a/Assets/Scripts/Managers/UIManager.cs
+++ b/Assets/Scripts/Managers/UIManager.cs
@@ -9,7 +9,8 @@
 {
     public GameObject damageTextPrefab;
     public GameObject healthTextPrefab;
-    public Canvas gameCanvas;
+    public Canvas playerUI;
+    public Canvas pauseMenuUI;
 
     private void OnEnable()
     {
@@ -31,7 +32,7 @@
         // Create damage text at character
         Vector3 spawnPosition = Camera.main.WorldToScreenPoint(character.transform.position);
 
-        TMP_Text tmpText = Instantiate(damageTextPrefab, spawnPosition, Quaternion.identity, gameCanvas.transform).GetComponent<TMP_Text>();
+        TMP_Text tmpText = Instantiate(damageTextPrefab, spawnPosition, Quaternion.identity, pauseMenuUI.transform).GetComponent<TMP_Text>();
 
         tmpText.text = damageReceived.ToString();
 
@@ -41,9 +42,13 @@
         // Create heal text at character
         Vector3 spawnPosition = Camera.main.WorldToScreenPoint(character.transform.position);
 
-        TMP_Text tmpText = Instantiate(healthTextPrefab, spawnPosition, Quaternion.identity, gameCanvas.transform).GetComponent<TMP_Text>();
+        TMP_Text tmpText = Instantiate(healthTextPrefab, spawnPosition, Quaternion.identity, pauseMenuUI.transform).GetComponent<TMP_Text>();
 
         tmpText.text = healthRestored.ToString();
 
     }
+    public void GameLoaded()
+    {
+        pauseMenuUI.GetComponent<Animator>().SetTrigger("GameLoaded");
+    }
 }

--
Gitblit v1.9.3