“cara mengunci dan menyembunyikan persatuan kursor” Kode Jawaban

cara mengunci dan menyembunyikan persatuan kursor

//to lock in the centre of window
Cursor.lockState = CursorLockMode.Locked;
//to hide the curser
Cursor.visible = false;


Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
GESCHICKTER ADLER

cara membuka kursor dalam persatuan

Cursor.lockState = CursorLockMode.None; // to unlock cursor
Cursor.visible = true; // to make cursor visible
Bloody Boar

cara mengunci dan menyembunyikan persatuan kursor

Well im pretty new in Unity so,, this thing: http://docs.unity3d.com/ScriptReference/Cursor-visible.html
and http://docs.unity3d.com/ScriptReference/Screen-lockCursor.html somehow does not work for me. What i want? Simply to hide cursor (so it wont be visible but will still be in the middle of the screen) so i can put some mine cursor on ,,, let me say, UI ,,,, , In Unity 4.something i was use:

Code (JavaScript):
function Update()
{
Cursor.visible = false;
Screen.lockCursor = true;
Screen.lockCursor = false;
}
And everything worked fine till Unity 5 where i get warning (and also this old script does not work anymore)
Assets/SCRIPTS/CenteredShowCursor.js(5,8): BCW0012: WARNING: 'UnityEngine.Screen.lockCursor' is obsolete. Property lockCursor has been deprecated. Use Cursor.lockState and Cursor.visible instead..
Is it any simply code to HIDE and Lock game cursor but still be able to use it in game ("to click on some objects inside the game")
IamYourDad

Jawaban yang mirip dengan “cara mengunci dan menyembunyikan persatuan kursor”

Pertanyaan yang mirip dengan “cara mengunci dan menyembunyikan persatuan kursor”

Lebih banyak jawaban terkait untuk “cara mengunci dan menyembunyikan persatuan kursor” di C#

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya