void CalculateCameraBoundaries() { if(settings.useBoundaries && ! ((inputs.useKeyCodeInputs)? (Input.GetKey(inputs.keycodes.CameraMoveRight)): (Input.GetButton(inputs.axis.button_camera_move_right)))) { // check if the pivot is not in a boundary if(!Moba_Camera_Boundaries.isPointInBoundary(requirements.pivot.position)) { // Get the closet boundary to the pivot Moba_Camera_Boundary boundary = Moba_Camera_Boundaries.GetClosestBoundary(requirements.pivot.position); if(boundary != null) { // set the pivot's position to the closet point on the boundary requirements.pivot.position = Moba_Camera_Boundaries.GetClosestPointOnBoundary(boundary, requirements.pivot.position); } } } }
private void CalculateCameraBoundaries() { if (this.settings.useBoundaries && !(this.inputs.useKeyCodeInputs ? Input.GetKey(this.inputs.keycodes.CameraMoveRight) : Input.GetButton(this.inputs.axis.button_camera_move_right)) && !Moba_Camera_Boundaries.isPointInBoundary(this.requirements.pivot.position)) { Moba_Camera_Boundary closestBoundary = Moba_Camera_Boundaries.GetClosestBoundary(this.requirements.pivot.position); if (closestBoundary != null) { this.requirements.pivot.position = Moba_Camera_Boundaries.GetClosestPointOnBoundary(closestBoundary, this.requirements.pivot.position); this.RelativeDisplacement = this.PreRelativeDisplacement; } } }