From 3b4fcffdc8ebd624c373c4df392157aac02bc00b Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 3 Apr 2023 13:27:53 -0400 Subject: [PATCH] added full replay loop --- namedropper/Assets/GameOverScreen.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/namedropper/Assets/GameOverScreen.cs b/namedropper/Assets/GameOverScreen.cs index 0cf27ca..af7e72d 100644 --- a/namedropper/Assets/GameOverScreen.cs +++ b/namedropper/Assets/GameOverScreen.cs @@ -1,6 +1,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.SceneManagement; using UnityEngine.UI; public class GameOverScreen : MonoBehaviour @@ -37,14 +38,22 @@ public class GameOverScreen : MonoBehaviour _gameOverMessage.text += "TIE!"; } - _gameOverMessage.text += "\n\nPress 'R' to replay"; + //_gameOverMessage.text += "\n\nPress 'R' to replay"; } + Invoke("Restart", 10); + } + private void Restart() + { + SceneManager.LoadScene("Title"); + } // Update is called once per frame void Update() { - + if (Input.GetMouseButtonDown(0)){ + Restart(); + } } }