mirror of
https://github.com/Steffo99/keep-everything-alive.git
synced 2024-11-25 02:34:18 +00:00
Fix game over bug
This commit is contained in:
parent
77793bdd9a
commit
b0f6fd9b57
1 changed files with 6 additions and 1 deletions
|
@ -168,15 +168,20 @@ public class GameController : MonoBehaviour
|
||||||
Timescale = startingTimescale;
|
Timescale = startingTimescale;
|
||||||
Score = startingScore;
|
Score = startingScore;
|
||||||
CurrentMicrogame = null;
|
CurrentMicrogame = null;
|
||||||
|
gameOverTimer = 0f;
|
||||||
// Notify the TimePanel of the starting status
|
// Notify the TimePanel of the starting status
|
||||||
OnMicrogameTimeLeftChange?.Invoke(null, null);
|
OnMicrogameTimeLeftChange?.Invoke(null, null);
|
||||||
|
|
||||||
StartCoroutine("SpinTheWheel");
|
StartCoroutine("SpinTheWheel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float gameOverRequiredTime = 4f;
|
||||||
|
private float gameOverTimer = 0f;
|
||||||
|
|
||||||
private void Update() {
|
private void Update() {
|
||||||
if(GameOver) {
|
if(GameOver) {
|
||||||
if(Input.anyKeyDown) {
|
gameOverTimer += Time.unscaledDeltaTime;
|
||||||
|
if(gameOverTimer >= gameOverRequiredTime && Input.anyKeyDown) {
|
||||||
SceneManager.LoadScene("Default");
|
SceneManager.LoadScene("Default");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue