From 2fe6417d63c6db787dd0c441f8f29847b97911cc Mon Sep 17 00:00:00 2001 From: yauwailam Date: Fri, 14 Feb 2025 13:03:21 +0800 Subject: [PATCH] change some scripts --- Game/Assets/Scenes/Day1.unity | 1 + Game/Assets/Scenes/Day2.unity | 1 + Game/Assets/Scripts/InfoCollector.cs | 4 ++-- Game/Assets/Scripts/LeaveHouseTrigger.cs | 20 ++++++++++++++++++-- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Game/Assets/Scenes/Day1.unity b/Game/Assets/Scenes/Day1.unity index c2151ee..d0326e2 100644 --- a/Game/Assets/Scenes/Day1.unity +++ b/Game/Assets/Scenes/Day1.unity @@ -275515,6 +275515,7 @@ MonoBehaviour: m_EditorClassIdentifier: gameManager: {fileID: 278618526} nextSceneName: Town + Day3: Day3 confirmationPanel: {fileID: 347656170} warningText: {fileID: 1839460625} warningPanel: {fileID: 1776114648} diff --git a/Game/Assets/Scenes/Day2.unity b/Game/Assets/Scenes/Day2.unity index 8df954a..7dcbdaf 100644 --- a/Game/Assets/Scenes/Day2.unity +++ b/Game/Assets/Scenes/Day2.unity @@ -276572,6 +276572,7 @@ MonoBehaviour: m_EditorClassIdentifier: gameManager: {fileID: 278618526} nextSceneName: Town + Day3: Day3 confirmationPanel: {fileID: 347656170} warningText: {fileID: 1839460625} warningPanel: {fileID: 1776114648} diff --git a/Game/Assets/Scripts/InfoCollector.cs b/Game/Assets/Scripts/InfoCollector.cs index 8bd1468..5a84b91 100644 --- a/Game/Assets/Scripts/InfoCollector.cs +++ b/Game/Assets/Scripts/InfoCollector.cs @@ -142,11 +142,11 @@ public class InfoCollector : MonoBehaviour if (obj.name == "Bottles") // Returns predefined information - return "Saw daddy drink this... I like how it numbs the pain"; + return "Saw dad drink this... I like how it numbs the pain"; if (obj.name == "Cigarettes") // Returns predefined information - return "Stole this from mommy. I hope she doesn't find out."; + return "Stole this from mom. I hope she doesn't find out."; if (obj.name == "Penknife") // Returns predefined information diff --git a/Game/Assets/Scripts/LeaveHouseTrigger.cs b/Game/Assets/Scripts/LeaveHouseTrigger.cs index e19e22e..fb41f03 100644 --- a/Game/Assets/Scripts/LeaveHouseTrigger.cs +++ b/Game/Assets/Scripts/LeaveHouseTrigger.cs @@ -16,6 +16,7 @@ public class LeaveHouseTrigger : MonoBehaviour // Name of the next scene public string nextSceneName; + public string Day3; public GameObject confirmationPanel; public TMP_Text warningText; public GameObject warningPanel; @@ -38,8 +39,17 @@ public class LeaveHouseTrigger : MonoBehaviour void ShowConfirmationButtons() { confirmationPanel.SetActive(true); - warningText.text = "Am I sure I want to 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 == 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) + { + warningText.text = "Do I even want to go to school..."; + StartCoroutine(HideWarningPanelAfterDelay(7f)); // can change how long you want the text to show for + } } IEnumerator HideWarningPanelAfterDelay(float delay) @@ -61,5 +71,11 @@ public class LeaveHouseTrigger : MonoBehaviour { confirmationPanel.SetActive(false); warningPanel.SetActive(true); + + if (gameManager.currentDay == 2) + { + gameManager.IncrementDay(); + SceneManager.LoadScene(Day3); + } } } \ No newline at end of file