diff options
Diffstat (limited to 'Assets/Scripts')
| -rw-r--r-- | Assets/Scripts/Exit.cs | 5 | ||||
| -rw-r--r-- | Assets/Scripts/PlayerMovement.cs | 4 | ||||
| -rw-r--r-- | Assets/Scripts/Quit.cs | 14 | ||||
| -rw-r--r-- | Assets/Scripts/Quit.cs.meta | 11 |
4 files changed, 27 insertions, 7 deletions
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: |
