Vérifiez si la souris est dans l'unité de cadre

// If you want to hide the mouse when it is in frame, use this:

var mouseLocation = Camera.current.ScreenToViewportPoint(Input.mousePosition);
        var outOfFrame = Mathf.Min(mouseLocation.x, mouseLocation.y) < 0 ||
                         Mathf.Max(mouseLocation.x, mouseLocation.y) > 1;
        UnityEngine.Cursor.visible = outOfFrame;

// If you want to prevent the mouse from leaving frame:

UnityEngine.Cursor.lockCursor = true;
Slush