Add key to allow quitting from the main game.

This commit is contained in:
Kaj Forney 2021-10-21 13:25:33 -06:00
parent 6998a09f19
commit f615313098
Signed by: kforney
GPG key ID: 3AB4E2E04CEF656F
2 changed files with 22 additions and 0 deletions

View file

@ -1,6 +1,7 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement;
public class tetrominoUserControl : MonoBehaviour public class tetrominoUserControl : MonoBehaviour
{ {
@ -53,6 +54,11 @@ public class tetrominoUserControl : MonoBehaviour
activeTetromino.gameObject.transform.Rotate(0,0,-90,Space.World); activeTetromino.gameObject.transform.Rotate(0,0,-90,Space.World);
GetComponent<AudioSource>().Play(); GetComponent<AudioSource>().Play();
} }
if (Input.GetButtonDown("Quit"))
{
SceneManager.LoadScene("titleScreen");
}
} }
public void setActiveTetromino(GameObject tetromino) public void setActiveTetromino(GameObject tetromino)

View file

@ -165,3 +165,19 @@ InputManager:
type: 0 type: 0
axis: 0 axis: 0
joyNum: 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