Files
Bombaleila/Assets/ThunderWire Studio/UHFPS/Content/Scripts/UnlockCursor.cs

23 lines
596 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
public class UnlockCursor : MonoBehaviour
{
void Awake()
{
// Разблокируем курсор
Cursor.lockState = CursorLockMode.None;
// Делаем его видимым
Cursor.visible = true;
}
// На случай, если какой-то другой скрипт попытается залочить его в Update
void LateUpdate()
{
if (Cursor.lockState != CursorLockMode.None)
{
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
}
}
}