using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SetMouseLock : MonoBehaviour
{
    public bool lockedOnStart = false;

    private void Start()
    {
        SetLock(lockedOnStart);
    }

    public void SetLock(bool enabled)
    {
        Cursor.lockState = enabled ? CursorLockMode.Locked : CursorLockMode.None;
        Cursor.visible = !enabled;
    }
}