From 85a709619788dc0bceb037d3eb5c7fd2ae533fff Mon Sep 17 00:00:00 2001 From: yauwailam Date: Fri, 14 Feb 2025 13:48:11 +0800 Subject: [PATCH] why no work CRI --- Game/Assets/Scenes/Town.unity | 6 +++--- Game/Assets/Scripts/GoToSchool.cs | 4 ++-- Game/Assets/Scripts/LeaveHouseTrigger.cs | 13 +++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Game/Assets/Scenes/Town.unity b/Game/Assets/Scenes/Town.unity index f5017b5..06a6132 100644 --- a/Game/Assets/Scenes/Town.unity +++ b/Game/Assets/Scenes/Town.unity @@ -338151,7 +338151,7 @@ BoxCollider: serializedVersion: 2 m_Bits: 0 m_LayerOverridePriority: 0 - m_IsTrigger: 0 + m_IsTrigger: 1 m_ProvidesContacts: 0 m_Enabled: 1 serializedVersion: 3 @@ -338165,13 +338165,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1801320666} serializedVersion: 2 - m_LocalRotation: {x: -0, y: -0.36041337, z: -0, w: 0.9327927} + m_LocalRotation: {x: -0, y: -0.36623102, z: -0, w: 0.930524} m_LocalPosition: {x: 15.56, y: 21.52, z: 1095.91} m_LocalScale: {x: 3.4323885, y: 3.094469, z: 8.355327} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: -42.251, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: -42.967, z: 0} --- !u!43 &1801863514 Mesh: m_ObjectHideFlags: 0 diff --git a/Game/Assets/Scripts/GoToSchool.cs b/Game/Assets/Scripts/GoToSchool.cs index e051256..7d0a599 100644 --- a/Game/Assets/Scripts/GoToSchool.cs +++ b/Game/Assets/Scripts/GoToSchool.cs @@ -95,7 +95,7 @@ public class GoToSchool : MonoBehaviour private void OnTriggerEnter(Collider other) { - + Debug.Log("Triggered by: " + other.gameObject.name); if (gameManager.currentDay == 2) { if (!atPond && other == parkPondTrigger) // Player arrives at pond first @@ -103,7 +103,7 @@ public class GoToSchool : MonoBehaviour atPond = true; StartCoroutine(StayAtPond()); } - else if (atPond && !hasTriggered && other == schoolTrigger) // Player can go to school after pond + else if (atPond && other == schoolTrigger) // Player can go to school after pond { hasTriggered = true; StartCoroutine(FadeInAndLoadScene()); diff --git a/Game/Assets/Scripts/LeaveHouseTrigger.cs b/Game/Assets/Scripts/LeaveHouseTrigger.cs index fb41f03..c6a8555 100644 --- a/Game/Assets/Scripts/LeaveHouseTrigger.cs +++ b/Game/Assets/Scripts/LeaveHouseTrigger.cs @@ -42,14 +42,15 @@ public class LeaveHouseTrigger : MonoBehaviour if (gameManager.currentDay == 1) { warningText.text = "Should I leave the house? I might not have completed everything..."; - StartCoroutine(HideWarningPanelAfterDelay(7f)); // can change how long you want the text to show for + } - if (gameManager.currentDay == 2) + else if (gameManager.currentDay == 2) { warningText.text = "Do I even want to go to school..."; - StartCoroutine(HideWarningPanelAfterDelay(7f)); // can change how long you want the text to show for + } + StartCoroutine(HideWarningPanelAfterDelay(7f)); // can change how long you want the text to show for } IEnumerator HideWarningPanelAfterDelay(float delay) @@ -69,13 +70,13 @@ public class LeaveHouseTrigger : MonoBehaviour public void CancelLeave() { - confirmationPanel.SetActive(false); - warningPanel.SetActive(true); - if (gameManager.currentDay == 2) { gameManager.IncrementDay(); SceneManager.LoadScene(Day3); } + confirmationPanel.SetActive(false); + warningPanel.SetActive(true); + } } \ No newline at end of file