From 6bf9825855d1804fe0c02a722aa8f83779dd84ce Mon Sep 17 00:00:00 2001 From: RochesterX Date: Tue, 4 Mar 2025 20:10:28 -0500 Subject: [PATCH] Fix GameManager --- Assets/Scripts/GameManager.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 5f96a35..082165b 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -7,6 +7,18 @@ public class GameManager : MonoBehaviour public int maxLives = 3; public int currentLives; + private void Awake() + { + if (Instance == null) + { + Instance = this; + } + else + { + Destroy(gameObject); + } + } + private void Start() { StartGame();