29 lines
642 B
C#
29 lines
642 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class DebugMouseLocker : MonoBehaviour
|
|
{
|
|
private bool locked = false;
|
|
void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.F6))
|
|
{
|
|
if (locked)
|
|
{
|
|
Cursor.visible = true;
|
|
Cursor.lockState = CursorLockMode.None;
|
|
|
|
locked = false;
|
|
}
|
|
else
|
|
{
|
|
Cursor.visible = false;
|
|
Cursor.lockState = CursorLockMode.Locked;
|
|
|
|
locked = true;
|
|
}
|
|
}
|
|
}
|
|
}
|