From e34322cee5db638dbcda2c826288fced5c1adf6d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 19 Apr 2020 18:12:45 +0200 Subject: [PATCH] Restart on Game Over --- Assets/Scripts/Core/GameController.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Assets/Scripts/Core/GameController.cs b/Assets/Scripts/Core/GameController.cs index 46189ca..8eca3df 100644 --- a/Assets/Scripts/Core/GameController.cs +++ b/Assets/Scripts/Core/GameController.cs @@ -1,6 +1,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.SceneManagement; public class GameController : MonoBehaviour { @@ -172,4 +173,12 @@ public class GameController : MonoBehaviour StartCoroutine("SpinTheWheel"); } + + private void Update() { + if(GameOver) { + if(Input.anyKeyDown) { + SceneManager.LoadScene("Default"); + } + } + } }