예제 #1
0
    private void Update()
    {
        var kb = Keyboard.current;

        if (kb.upArrowKey.wasPressedThisFrame)
        {
            cameraView.ProcessUpDown(1);
        }
        if (kb.downArrowKey.wasPressedThisFrame)
        {
            cameraView.ProcessUpDown(-1);
        }
        if (kb.rightArrowKey.wasPressedThisFrame)
        {
            ChangeView(1);
        }
        if (kb.leftArrowKey.wasPressedThisFrame)
        {
            ChangeView(-1);
        }
        var y = Mouse.current.scroll.y.ReadValue();

        if (Math.Abs(y) > 1e-5)
        {
            cameraView.ProcessMouseWheelInput(-y / 5f);
        }
    }