From dd117b77aae1d8be7563b360d05b842a73b7dab2 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 20 Apr 2020 19:08:59 -0400 Subject: Upgraded Unity --- Assets/Scripts/Exit.cs | 5 +---- Assets/Scripts/PlayerMovement.cs | 4 +--- Assets/Scripts/Quit.cs | 14 ++++++++++++++ Assets/Scripts/Quit.cs.meta | 11 +++++++++++ 4 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 Assets/Scripts/Quit.cs create mode 100644 Assets/Scripts/Quit.cs.meta (limited to 'Assets/Scripts') diff --git a/Assets/Scripts/Exit.cs b/Assets/Scripts/Exit.cs index a0feb04..ea092b0 100644 --- a/Assets/Scripts/Exit.cs +++ b/Assets/Scripts/Exit.cs @@ -1,6 +1,4 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; +using UnityEngine; public class Exit : MonoBehaviour { @@ -9,7 +7,6 @@ public class Exit : MonoBehaviour { if (Input.GetKey("escape")) { - Debug.Log("Game is now closed."); Application.Quit(); } diff --git a/Assets/Scripts/PlayerMovement.cs b/Assets/Scripts/PlayerMovement.cs index b0b6874..cf131be 100644 --- a/Assets/Scripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerMovement.cs @@ -1,6 +1,4 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; +using UnityEngine; public class PlayerMovement : MonoBehaviour { diff --git a/Assets/Scripts/Quit.cs b/Assets/Scripts/Quit.cs new file mode 100644 index 0000000..ea092b0 --- /dev/null +++ b/Assets/Scripts/Quit.cs @@ -0,0 +1,14 @@ +using UnityEngine; + +public class Exit : MonoBehaviour +{ + // Update is called once per frame + void Update() + { + if (Input.GetKey("escape")) + { + Application.Quit(); + } + + } +} diff --git a/Assets/Scripts/Quit.cs.meta b/Assets/Scripts/Quit.cs.meta new file mode 100644 index 0000000..87fc2df --- /dev/null +++ b/Assets/Scripts/Quit.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3aa4285199d3f6f3a88d2b5993d8adfd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: -- cgit v1.2.3