Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DistanceToRectangle(Vector3, Quaternion, float)

Returns the distance in pixels from the mouse pointer to a rectangle on screen.
Read time 1 minuteLast updated 8 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor
public static float DistanceToRectangle(Vector3 position, Quaternion rotation, float size)

Parameters

position


rotation


size

Returns

Type

Description

float

Remarks

Calculates the screen space distance from the mouse pointer to the rectangle.
Uses the current camera to determine the distance.