From b13dbcb87b255bea2f2b41a2d4d2bb2d2bf86688 Mon Sep 17 00:00:00 2001 From: Christer Date: Thu, 30 Apr 2020 01:56:05 +0300 Subject: [PATCH] Press ESC to get back to main menu --- Jump Game/Assets/Scripts/Player/PlayerController.cs | 5 ++++- Jump Game/ProjectSettings/ProjectSettings.asset | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Jump Game/Assets/Scripts/Player/PlayerController.cs b/Jump Game/Assets/Scripts/Player/PlayerController.cs index 8c0d846..2575c62 100644 --- a/Jump Game/Assets/Scripts/Player/PlayerController.cs +++ b/Jump Game/Assets/Scripts/Player/PlayerController.cs @@ -1,6 +1,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.SceneManagement; public class PlayerController : Player { @@ -53,7 +54,9 @@ public class PlayerController : Player isGrounded = Physics2D.OverlapArea(feetPos.position, checkRadius.position, whatIsGround); //return true for overlap moveInput = Input.GetAxis("Horizontal"); - if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } //temporary exit measure + if (Input.GetKeyDown(KeyCode.Escape)) { + SceneManager.LoadScene(0); + } if(_isGrounded && Input.GetAxis("Horizontal") != -1 && Input.GetAxis("Horizontal") != 1) { Player.rbody.velocity = new Vector2(0, Player.rbody.velocity.y); } diff --git a/Jump Game/ProjectSettings/ProjectSettings.asset b/Jump Game/ProjectSettings/ProjectSettings.asset index 9798463..027d85f 100644 --- a/Jump Game/ProjectSettings/ProjectSettings.asset +++ b/Jump Game/ProjectSettings/ProjectSettings.asset @@ -98,7 +98,7 @@ PlayerSettings: visibleInBackground: 1 allowFullscreenSwitch: 1 graphicsJobMode: 0 - fullscreenMode: 3 + fullscreenMode: 1 xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 xboxEnableGuest: 0 @@ -121,7 +121,7 @@ PlayerSettings: m_SupportedAspectRatios: 4:3: 0 5:4: 0 - 16:10: 1 + 16:10: 0 16:9: 1 Others: 0 bundleVersion: 0.1