summaryrefslogtreecommitdiff
path: root/Assets/Scripts/UnlockCursor.cs
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-08-24 00:14:06 -0400
committerAndrew Lee <alee14498@protonmail.com>2020-08-24 00:14:06 -0400
commit581eb102d540bc495ec62dae25fcea0d676d1a59 (patch)
tree898078c2580819b953ad7696779269827667e853 /Assets/Scripts/UnlockCursor.cs
parent4c192cebf7af6c271b8a8a9b10616c85ab2856dd (diff)
downloadProject-Sandbox-581eb102d540bc495ec62dae25fcea0d676d1a59.tar.gz
Project-Sandbox-581eb102d540bc495ec62dae25fcea0d676d1a59.tar.bz2
Project-Sandbox-581eb102d540bc495ec62dae25fcea0d676d1a59.zip
Dialogue; Unlock cursor
Diffstat (limited to 'Assets/Scripts/UnlockCursor.cs')
-rw-r--r--Assets/Scripts/UnlockCursor.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/Assets/Scripts/UnlockCursor.cs b/Assets/Scripts/UnlockCursor.cs
new file mode 100644
index 0000000..3f3812c
--- /dev/null
+++ b/Assets/Scripts/UnlockCursor.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class UnlockCursor : MonoBehaviour
+{
+ public bool lockCursor = true;
+ // Update is called once per frame
+ void Update()
+ {
+ if (Input.GetKeyDown(KeyCode.F1))
+ {
+ lockCursor = !lockCursor;
+ }
+
+ Cursor.lockState = lockCursor ? CursorLockMode.Locked : CursorLockMode.None;
+ Cursor.visible = !lockCursor;
+
+ }
+
+}