# CameraProjectionCache

> Project points from world to screen space.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public struct CameraProjectionCache
```

## Remarks

Projection from world to screen space depends on internal camera matrices that Unity must recalculate whenever they are accessed. When accessed in a loop where the camera state does not change, these calculations are not necessary, which results in significant performance improvements.

## Constructors

| Constructor                                                                                                            | Description                                                      |
| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| [CameraProjectionCache(UnityEngine.Camera)](/engine/6000.0/script-reference/unityeditor/cameraprojectioncache/ctor.md) | Creates a CameraProjectionCache with the camera's current state. |

## Methods

| Method                                                                                                        | Description                                                                                                                                                                                            |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [GUIToScreenPoint](/engine/6000.0/script-reference/unityeditor/cameraprojectioncache/guitoscreenpoint.md)     | Converts a point from GUI position to screen space relative to the cached camera viewport.                                                                                                             |
| [ScreenToGUIPoint](/engine/6000.0/script-reference/unityeditor/cameraprojectioncache/screentoguipoint.md)     | Converts a point from screen space to GUI position relative to the viewport at the time the [CameraProjectionCache](/engine/6000.0/script-reference/unityeditor/cameraprojectioncache.md) was created. |
| [WorldToGUIPoint](/engine/6000.0/script-reference/unityeditor/cameraprojectioncache/worldtoguipoint.md)       | Converts a world space point to a 2D GUI position.                                                                                                                                                     |
| [WorldToScreenPoint](/engine/6000.0/script-reference/unityeditor/cameraprojectioncache/worldtoscreenpoint.md) | Transforms position from world space into screen space using the cached camera projection and viewport.                                                                                                |
