Warp traps and tidying up the house

This commit is contained in:
2025-12-04 10:53:21 +00:00
parent e0c93be280
commit 00a433132b
38 changed files with 4036 additions and 192 deletions

View File

@@ -1,15 +1,15 @@
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.SceneManagement;
public class StaircaseCurse : MonoBehaviour
{
[Header("Don't Look Back Settings")]
[Range(-1f, 1f)] public float killThreshold = -0.2f;
public GameObject blackScreenPanel;
[Range(-1f, 1f)] public float killThreshold = -0.2f;
public GameObject blackScreenPanel;
[Header("Spooky Audio System")]
[Tooltip("Drag empty GameObjects with AudioSources from around the map here")]
public AudioSource[] environmentalSources;
public AudioSource[] environmentalSources;
public AudioClip[] scaryClips; // Whispers, footsteps, wood creaks
[Tooltip("Minimum seconds between random noises")]
public float minSoundDelay = 2f;
@@ -37,7 +37,7 @@ public class StaircaseCurse : MonoBehaviour
if (GameManager.Instance != null && !GameManager.Instance.AreAnyLightsOn())
{
CheckPlayerFacing();
// 2. HANDLE RANDOM AUDIO
HandleAudio();
}
@@ -46,7 +46,7 @@ public class StaircaseCurse : MonoBehaviour
void HandleAudio()
{
soundTimer -= Time.deltaTime;
if (soundTimer <= 0)
{
PlayRandomSound();
@@ -88,11 +88,11 @@ public class StaircaseCurse : MonoBehaviour
{
isDead = true;
if (blackScreenPanel != null) blackScreenPanel.SetActive(true);
// Disable controls
if (playerTransform.GetComponent<PlayerController>())
playerTransform.GetComponent<PlayerController>().enabled = false;
Invoke("RestartLevel", 3f);
}