change some scripts

This commit is contained in:
yauwailam 2025-02-14 13:03:21 +08:00
parent 47fa2ba969
commit 2fe6417d63
4 changed files with 22 additions and 4 deletions

View file

@ -275515,6 +275515,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
gameManager: {fileID: 278618526} gameManager: {fileID: 278618526}
nextSceneName: Town nextSceneName: Town
Day3: Day3
confirmationPanel: {fileID: 347656170} confirmationPanel: {fileID: 347656170}
warningText: {fileID: 1839460625} warningText: {fileID: 1839460625}
warningPanel: {fileID: 1776114648} warningPanel: {fileID: 1776114648}

View file

@ -276572,6 +276572,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
gameManager: {fileID: 278618526} gameManager: {fileID: 278618526}
nextSceneName: Town nextSceneName: Town
Day3: Day3
confirmationPanel: {fileID: 347656170} confirmationPanel: {fileID: 347656170}
warningText: {fileID: 1839460625} warningText: {fileID: 1839460625}
warningPanel: {fileID: 1776114648} warningPanel: {fileID: 1776114648}

View file

@ -142,11 +142,11 @@ public class InfoCollector : MonoBehaviour
if (obj.name == "Bottles") if (obj.name == "Bottles")
// Returns predefined information // 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") if (obj.name == "Cigarettes")
// Returns predefined information // 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") if (obj.name == "Penknife")
// Returns predefined information // Returns predefined information

View file

@ -16,6 +16,7 @@ public class LeaveHouseTrigger : MonoBehaviour
// Name of the next scene // Name of the next scene
public string nextSceneName; public string nextSceneName;
public string Day3;
public GameObject confirmationPanel; public GameObject confirmationPanel;
public TMP_Text warningText; public TMP_Text warningText;
public GameObject warningPanel; public GameObject warningPanel;
@ -38,8 +39,17 @@ public class LeaveHouseTrigger : MonoBehaviour
void ShowConfirmationButtons() void ShowConfirmationButtons()
{ {
confirmationPanel.SetActive(true); confirmationPanel.SetActive(true);
warningText.text = "Am I sure I want to leave the house? I might not have completed everything..."; if (gameManager.currentDay == 1)
StartCoroutine(HideWarningPanelAfterDelay(7f)); // can change how long you want the text to show for {
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) IEnumerator HideWarningPanelAfterDelay(float delay)
@ -61,5 +71,11 @@ public class LeaveHouseTrigger : MonoBehaviour
{ {
confirmationPanel.SetActive(false); confirmationPanel.SetActive(false);
warningPanel.SetActive(true); warningPanel.SetActive(true);
if (gameManager.currentDay == 2)
{
gameManager.IncrementDay();
SceneManager.LoadScene(Day3);
}
} }
} }