Version: 2020.3

HandleUtility.DistanceToRectangle

切换到手册
public static float DistanceToRectangle (Vector3 position, Quaternion rotation, float size);

描述

Returns the distance in pixels from the mouse pointer to a rectangle on screen.

计算从鼠标指针到矩形的屏幕空间距离。

使用当前摄像机确定距离。