From f6153130980a9726438338b0c6323105e1709b56 Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Thu, 21 Oct 2021 13:25:33 -0600 Subject: [PATCH] Add key to allow quitting from the main game. --- Assets/Scripts/tetrominoUserControl.cs | 6 ++++++ ProjectSettings/InputManager.asset | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Assets/Scripts/tetrominoUserControl.cs b/Assets/Scripts/tetrominoUserControl.cs index e26196c..0ceb513 100644 --- a/Assets/Scripts/tetrominoUserControl.cs +++ b/Assets/Scripts/tetrominoUserControl.cs @@ -1,6 +1,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.SceneManagement; public class tetrominoUserControl : MonoBehaviour { @@ -53,6 +54,11 @@ public class tetrominoUserControl : MonoBehaviour activeTetromino.gameObject.transform.Rotate(0,0,-90,Space.World); GetComponent().Play(); } + + if (Input.GetButtonDown("Quit")) + { + SceneManager.LoadScene("titleScreen"); + } } public void setActiveTetromino(GameObject tetromino) diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset index bf73443..82a8bff 100644 --- a/ProjectSettings/InputManager.asset +++ b/ProjectSettings/InputManager.asset @@ -165,3 +165,19 @@ InputManager: type: 0 axis: 0 joyNum: 0 + - serializedVersion: 3 + m_Name: Quit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: escape + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0