diff options
Diffstat (limited to 'Assets/Scripts/UnlockCursor.cs')
| -rw-r--r-- | Assets/Scripts/UnlockCursor.cs | 22 |
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;
+
+ }
+
+}
|
