Added Start Menu, -Added CartSpawner, -Added Get Car Key Objective
This commit is contained in:
parent
f737955a88
commit
e7f50f7108
100 changed files with 5304 additions and 16 deletions
32
Assets/Scripts/Day1CarExitTrigger.cs
Normal file
32
Assets/Scripts/Day1CarExitTrigger.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
public class Day1CarExitTrigger : MonoBehaviour
|
||||
{
|
||||
public GameObject dayCompleteUI; // UI panel that shows "Day 1 Complete!"
|
||||
public TMP_Text messageText; // Optional text to show messages
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (!other.CompareTag("Player")) return;
|
||||
|
||||
if (KeyPickup.hasKeys)
|
||||
{
|
||||
if (dayCompleteUI != null)
|
||||
dayCompleteUI.SetActive(true);
|
||||
|
||||
if (messageText != null)
|
||||
messageText.text = "Day 1 Complete!";
|
||||
|
||||
Debug.Log("Day complete! Player has keys.");
|
||||
Time.timeScale = 0f;
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
Cursor.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (messageText != null)
|
||||
messageText.text = "You need to find your keys near the car!";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue