From 08ea77e75c1b4bfc45d5f18195f7373ad1625c7a Mon Sep 17 00:00:00 2001 From: yauwailam Date: Fri, 14 Feb 2025 09:44:51 +0800 Subject: [PATCH] I FIXED IT --- Game/Assets/Scripts/GoToSchool.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Game/Assets/Scripts/GoToSchool.cs b/Game/Assets/Scripts/GoToSchool.cs index 4f80fcf..a7e11b5 100644 --- a/Game/Assets/Scripts/GoToSchool.cs +++ b/Game/Assets/Scripts/GoToSchool.cs @@ -35,7 +35,7 @@ public class GoToSchool : MonoBehaviour void Awake() { Debug.Log("IM AWAKE"); - DontDestroyOnLoad(gameObject); + // DontDestroyOnLoad(gameObject); gameManager = GameManager.Instance; // Reference to GameManager instance Debug.Log("currentday: " + gameManager.currentDay); if (storyPanelUI == null) @@ -95,13 +95,15 @@ public class GoToSchool : MonoBehaviour hasTriggered = true; StartCoroutine(FadeInAndLoadScene()); gameManager.GoToSchoolTaskComplete(); + gameManager.IncrementDay(); } } - else if (!hasTriggered && other == schoolTrigger) // Normal case for Day 1 + else if (gameManager.currentDay == 1) // Normal case for Day 1 { hasTriggered = true; StartCoroutine(FadeInAndLoadScene()); gameManager.GoToSchoolTaskComplete(); + gameManager.IncrementDay(); } } @@ -124,8 +126,6 @@ public class GoToSchool : MonoBehaviour SceneManager.LoadScene(nextScene); yield return new WaitForSeconds(1f); // Small delay to ensure scene transition - - gameManager.IncrementDay(); // Now called *after* scene fully loads xrRig.ResetingPosition(); }