WorldToGUIPointWithDepth
Convert a world space point to a 2D GUI position.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
WorldToGUIPointWithDepth(Vector3)
Convert a world space point to a 2D GUI position.
public static Vector3 WorldToGUIPointWithDepth(Vector3 world)
Parameters
Point in world space.
Returns
Type | Description |
|---|---|
| Vector3 | A Vector3 where the x and y values relate to the 2D GUI position. The z value is the distance in world units from the camera. |
Remarks
Uses the current camera to calculate the projection.
Additional Resources: HandleUtility.WorldToGUIPoint. HandleUtility.GUIPointToWorldRay, HandleUtility.RaySnap.
WorldToGUIPointWithDepth(Camera, Vector3)
Convert a world space point to a 2D GUI position.
public static Vector3 WorldToGUIPointWithDepth(Camera camera, Vector3 world)
Parameters
Returns
Type | Description |
|---|---|
| Vector3 | A Vector3 where the x and y values relate to the 2D GUI position. The z value is the distance in world units from the camera. |
Remarks
Uses the current camera to calculate the projection.
Additional Resources: HandleUtility.WorldToGUIPoint. HandleUtility.GUIPointToWorldRay, HandleUtility.RaySnap.