Version: 2022.3

HandleUtility.WorldToGUIPointWithDepth

切换到手册
public static Vector3 WorldToGUIPointWithDepth (Vector3 world);

参数

world 世界空间中的点。

返回

Vector3 Vector3 中的 x 和 y 值与 2D GUI 位置相关。z 值是相对于摄像机的距离(采用世界单位)。

描述

将世界空间点转换为 2D GUI 位置。

使用当前摄像机计算投影。

另请参阅:WorldToGUIPointGUIPointToWorldRayRaySnap