//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;
Cursor.lockState = CursorLockMode.None; // to unlock cursor
Cursor.visible = true; // to make cursor visible
CursCursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
Cursor.lockState = CursorLockMode.None; // this is to lock the cursor
Cursor.visible = true; //this is to make cursor visible
Cursor.lockState = CursorLockMode.None; // this is to unlock the cursor
Cursor.visible = true;