Ejemplo n.º 1
0
    private void SetVerticalBoundaries(VerticalLockSettings verticalLockSettings, CameraController cameraController)
    {
        verticalLockSettings.TopBoundary =
            verticalLockSettings.TopVerticalLockPosition
            - cameraController.TargetScreenSize.y * .5f / ZoomSettings.ZoomPercentage;

        verticalLockSettings.BottomBoundary =
            verticalLockSettings.BottomVerticalLockPosition
            + cameraController.TargetScreenSize.y * .5f / ZoomSettings.ZoomPercentage;
    }
Ejemplo n.º 2
0
 public CameraMovementSettings(VerticalLockSettings verticalLockSettings, HorizontalLockSettings horizontalLockSettings
                               , ZoomSettings zoomSettings, SmoothDampMoveSettings smoothDampMoveSettings
                               , Vector2 offset
                               , VerticalCameraFollowMode verticalCameraFollowMode
                               , float horizontalOffsetDeltaMovementFactor
                               )
 {
     this.horizontalLockSettings = horizontalLockSettings;
     this.verticalLockSettings   = verticalLockSettings;
     this.offset                              = offset;
     this.zoomSettings                        = zoomSettings;
     this.smoothDampMoveSettings              = smoothDampMoveSettings;
     this.verticalCameraFollowMode            = verticalCameraFollowMode;
     this.horizontalOffsetDeltaMovementFactor = horizontalOffsetDeltaMovementFactor;
 }
Ejemplo n.º 3
0
    private VerticalLockSettings CreateVerticalLockSettings(Bounds bounds, CameraController cameraController)
    {
        var verticalLockSettings = new VerticalLockSettings
        {
            Enabled = true,
            EnableDefaultVerticalLockPosition = false,
            DefaultVerticalLockPosition       = 0f,
            EnableTopVerticalLock             = true,
            EnableBottomVerticalLock          = true,
            TopVerticalLockPosition           = bounds.max.y,
            BottomVerticalLockPosition        = bounds.min.y
        };

        SetVerticalBoundaries(verticalLockSettings, cameraController);

        return(verticalLockSettings);
    }
Ejemplo n.º 4
0
    private VerticalLockSettings CreateVerticalLockSettings()
    {
        var verticalLockSettings = new VerticalLockSettings
        {
            Enabled = true,
            EnableDefaultVerticalLockPosition = false,
            DefaultVerticalLockPosition       = 0f,
            EnableTopVerticalLock             = true,
            EnableBottomVerticalLock          = true,
            TopVerticalLockPosition           = transform.position.y + Size.y * .5f,
            BottomVerticalLockPosition        = transform.position.y - Size.y * .5f
        };

        verticalLockSettings.TopBoundary =
            verticalLockSettings.TopVerticalLockPosition
            - _cameraController.TargetScreenSize.y * .5f / ZoomSettings.ZoomPercentage;

        verticalLockSettings.BottomBoundary =
            verticalLockSettings.BottomVerticalLockPosition
            + _cameraController.TargetScreenSize.y * .5f / ZoomSettings.ZoomPercentage;

        return(verticalLockSettings);
    }