Beispiel #1
0
    public float ScrollWheel()
    {
        Vector2 scrollWheelLimit       = cameraMovementController.ScrollWheelLimit;
        float   cameraOrthographicSize = cameraMovementController.CameraOrthographicSize;
        float   mouseScrollWheel       = mouse.GetMouseScrollWheel();

        if (mouseScrollWheel > 0)
        {
            if (cameraOrthographicSize > scrollWheelLimit.x && cameraOrthographicSize < scrollWheelLimit.y ||
                cameraOrthographicSize >= scrollWheelLimit.y)
            {
                cameraOrthographicSize -= cameraMovementController.ScrollSpeed;
            }
        }
        else if (mouseScrollWheel < 0)
        {
            if (cameraOrthographicSize > scrollWheelLimit.x && cameraOrthographicSize < scrollWheelLimit.y ||
                cameraOrthographicSize <= scrollWheelLimit.x)
            {
                cameraOrthographicSize += cameraMovementController.ScrollSpeed;
            }
        }
        return(cameraOrthographicSize);
    }