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; }
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; }
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); }
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); }