1006 마우스 가두기

null·2023년 10월 10일

Unity Study

목록 보기
18/60
using UnityEngine;
using System.Collections;

public class CursorLockHide : MonoBehaviour
{
    void Start()
    {
        Cursor.lockState = CursorLockMode.Locked; // Defaults cursor invisible
    }

    void Update()
    {
        /*
        if (Input.GetKeyDown(KeyCode.Q))
        {
            Cursor.lockState = CursorLockMode.Locked;
        }
        if (Input.GetKeyDown(KeyCode.E))
        {
            Cursor.lockState = CursorLockMode.None;
        }

        if (Input.GetKeyDown(KeyCode.Z))
        {
            Cursor.visible = false;
        }
        if (Input.GetKeyDown(KeyCode.X))
        {
            Cursor.visible = true;
        }
        */

        Cursor.visible = true; // Defaults, if press left mouse, cursor reset to center (❤ ω ❤)
    }

}

0개의 댓글