mirror of
https://github.com/Steffo99/keep-everything-alive.git
synced 2024-11-21 17:04:20 +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;
|
||||
Score = startingScore;
|
||||
CurrentMicrogame = null;
|
||||
gameOverTimer = 0f;
|
||||
// Notify the TimePanel of the starting status
|
||||
OnMicrogameTimeLeftChange?.Invoke(null, null);
|
||||
|
||||
StartCoroutine("SpinTheWheel");
|
||||
}
|
||||
|
||||
public float gameOverRequiredTime = 4f;
|
||||
private float gameOverTimer = 0f;
|
||||
|
||||
private void Update() {
|
||||
if(GameOver) {
|
||||
if(Input.anyKeyDown) {
|
||||
gameOverTimer += Time.unscaledDeltaTime;
|
||||
if(gameOverTimer >= gameOverRequiredTime && Input.anyKeyDown) {
|
||||
SceneManager.LoadScene("Default");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue