예제 #1
0
    // ToggleControlMode - Changes camera control style.
    public void ToggleControlMode()
    {
        if (mode == CameraController.ControlMode.Keyboard)
        {
            mode             = CameraController.ControlMode.Mouse;
            Cursor.lockState = CursorLockMode.Locked;                   // Hides and locks cursor in the center.
            Cursor.visible   = false;
        }
        else if (mode == CameraController.ControlMode.Mouse)
        {
            mode             = CameraController.ControlMode.Keyboard;
            Cursor.lockState = CursorLockMode.None;             // Undoes lock. Lock always undone by Escape due to Unity implementation.
            Cursor.visible   = true;
        }

        //mode = CameraController.ControlMode.Keyboard;
    }
예제 #2
0
 public void ToggleControlMode()
 {
     mode = CameraController.ControlMode.Keyboard;
 }