Version: 2022.3

HandleUtility.WorldPointToSizedRect

切换到手册
public static Rect WorldPointToSizedRect (Vector3 position, GUIContent content, GUIStyle style);

参数

position 要使用的世界空间位置。
content 为其保留空间的内容。
style 要使用的样式。样式的对齐方式。

描述

计算一个用于在 3D 空间中投影点附近显示 2D GUI 元素的矩形。

在摄像机移动时,如果 3D 对象需要那些在 3D 空间围绕它们旋转的标签或其他 2D 控件,此函数非常有用。