16 lines
509 B
C#
16 lines
509 B
C#
using UnityEngine;
|
|
using UnityEngine.Rendering.PostProcessing;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class GameOverVR : MonoBehaviour {
|
|
public PostProcessVolume DarknessVolume;
|
|
public GameState GameState;
|
|
|
|
private void Update() {
|
|
DarknessVolume.weight = Mathf.Lerp(DarknessVolume.weight, GameState.Current == State.GameOver ? 1 : 0, 0.5f * Time.deltaTime);
|
|
if (DarknessVolume.weight >= 0.9) {
|
|
SceneManager.LoadScene("Scenes/VRGameOverScene");
|
|
}
|
|
}
|
|
}
|