2020-06-11 23:10:30 +02:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.Rendering.PostProcessing;
|
|
|
|
|
using UnityEngine.SceneManagement;
|
|
|
|
|
|
|
|
|
|
public class GameOverVR : MonoBehaviour {
|
|
|
|
|
public PostProcessVolume DarknessVolume;
|
|
|
|
|
public GameState GameState;
|
|
|
|
|
|
|
|
|
|
private void Update() {
|
2020-06-13 01:12:10 +02:00
|
|
|
|
DarknessVolume.weight = Mathf.Lerp(DarknessVolume.weight, GameState.Current == State.GameOver ? 1 : 0, 0.5f * Time.deltaTime);
|
2020-06-13 01:18:04 +02:00
|
|
|
|
if (DarknessVolume.weight >= 0.9) {
|
2020-06-11 23:10:30 +02:00
|
|
|
|
SceneManager.LoadScene("Scenes/VRGameOverScene");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|