Warp traps and tidying up the house
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user