From 7a33995eb34e624b17093a2e3d49574df683bf78 Mon Sep 17 00:00:00 2001 From: SpoodyTheOne Date: Sun, 4 Feb 2024 11:35:13 +0100 Subject: [PATCH] Revive text! --- Assets/Scenes/GameScene.unity | 1 + Assets/Scripts/Managers/GameManager.cs | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index 801d9c5..9744ae4 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -3455,6 +3455,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: ReviveParticleSystem: {fileID: 1678451168} + ReviveText: {fileID: 730370596} --- !u!4 &1566837129 stripped Transform: m_CorrespondingSourceObject: {fileID: 3032075919872812610, guid: ec5007446d8bbca48bf02b3a7e752da1, type: 3} diff --git a/Assets/Scripts/Managers/GameManager.cs b/Assets/Scripts/Managers/GameManager.cs index dbd00ac..75aeb8d 100644 --- a/Assets/Scripts/Managers/GameManager.cs +++ b/Assets/Scripts/Managers/GameManager.cs @@ -17,6 +17,8 @@ public class GameManager : MonoBehaviour public GameObject ReviveParticleSystem; + public TMPro.TextMeshProUGUI ReviveText; + void Awake() { if (Instance == null) @@ -24,6 +26,7 @@ public class GameManager : MonoBehaviour Instance = this; DontDestroyOnLoad(gameObject); Revives = 1; + ReviveText.text = Revives + "x"; } else { @@ -46,6 +49,7 @@ public class GameManager : MonoBehaviour else { Revives--; + ReviveText.text = Revives + "x"; Collider2D[] d = Physics2D.OverlapCircleAll(who.transform.position, 3f); Debug.Log(d); @@ -72,8 +76,10 @@ public class GameManager : MonoBehaviour } } - public void AddRevive() { + public void AddRevive() + { Revives++; + ReviveText.text = Revives + "x"; } public void setTime(string t)