GetClosestBoundary() public static method

public static GetClosestBoundary ( Vector3 point ) : Moba_Camera_Boundary,
point Vector3
return Moba_Camera_Boundary,
Beispiel #1
0
 private void CalculateCameraBoundaries()
 {
     if (this.settings.useBoundaries && !((!this.inputs.useKeyCodeInputs) ? Input.GetButton(this.inputs.axis.button_camera_move_right) : Input.GetKey(this.inputs.keycodes.CameraMoveRight)) && !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);
         }
     }
 }
Beispiel #2
0
	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);
				}
			}
		}
	}