dieing
This commit is contained in:
@@ -56,6 +56,8 @@ public class CameraController : MonoBehaviour
|
||||
private float currentFocusOffsetX = 0f;
|
||||
private bool isSequencePlaying = false;
|
||||
|
||||
public GameObject globalLight;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (explorationCamera != null)
|
||||
@@ -171,7 +173,7 @@ public class CameraController : MonoBehaviour
|
||||
RemoveHighlight();
|
||||
|
||||
activeDoor.transform.FindChildRecursive("DOORPANEL").gameObject.GetComponent<Renderer>().material = activeDoor.openMaterial;
|
||||
|
||||
|
||||
// 1. TRIPWIRE: Check if the slots are empty!
|
||||
if (activeDoor.type == "DEATH")
|
||||
{
|
||||
@@ -198,22 +200,28 @@ public class CameraController : MonoBehaviour
|
||||
activeCam.Priority = 30;
|
||||
|
||||
yield return new WaitForSeconds(1f);
|
||||
|
||||
|
||||
// --- DISTANCE MOVEMENT FIX ---
|
||||
// Using real metres now! 5f means 5 metres per second. Adjust this if it falls too slowly!
|
||||
float pushSpeed = 5f;
|
||||
float previousPosition = -1f;
|
||||
|
||||
float counter = 0f;
|
||||
|
||||
while (activeDoor != null && activeDolly != null && activeDolly.CameraPosition > previousPosition)
|
||||
{
|
||||
previousPosition = activeDolly.CameraPosition;
|
||||
activeDolly.CameraPosition += pushSpeed * Time.deltaTime;
|
||||
counter += Time.deltaTime;
|
||||
if (counter > 4f && isDeathDoor)
|
||||
{
|
||||
globalLight.SetActive(true);
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
// ------------------------------
|
||||
|
||||
string doorType = activeDoor != null ? activeDoor.type : "";
|
||||
|
||||
|
||||
// --- PRIORITY FIX ---
|
||||
if (doorType == "LIFE")
|
||||
{
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class ReloadLevelScript : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void ReloadLevel()
|
||||
{
|
||||
SceneManager.LoadScene(1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 722c65ca6f07d91b79eb2352bccae710
|
||||
Reference in New Issue
Block a user